def install(): opts = layer.options('snap') for snapname, snap_opts in opts.items(): installed_state = 'snap.installed.{}'.format(snapname) if not reactive.is_state(installed_state): snap.install(snapname, **snap_opts) if data_changed('snap.install.opts', opts): snap.connect_all()
def install_snaps(): ''' Deliver the e2e and kubectl components from the binary resource stream packages declared in the charm ''' channel = hookenv.config('channel') hookenv.status_set('maintenance', 'Installing kubectl snap') snap.install('kubectl', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kubernetes-test snap') snap.install('kubernetes-test', channel=channel, classic=True) set_state('kubernetes-e2e.installed')
def install_snaps(): channel = hookenv.config('channel') hookenv.status_set('maintenance', 'Installing kubectl snap') snap.install('kubectl', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kube-apiserver snap') snap.install('kube-apiserver', channel=channel) hookenv.status_set('maintenance', 'Installing kube-controller-manager snap') snap.install('kube-controller-manager', channel=channel) hookenv.status_set('maintenance', 'Installing kube-scheduler snap') snap.install('kube-scheduler', channel=channel) hookenv.status_set('maintenance', 'Installing cdk-addons snap') snap.install('cdk-addons', channel=channel) set_state('kubernetes-master.snaps.installed')
def install_etcd(): ''' Attempt resource get on the "etcd" and "etcdctl" resources. If no resources are provided attempt to install from the archive only on the 16.04 (xenial) series. ''' if is_state('etcd.installed'): msg = 'Manual upgrade required. run-action snap-upgrade.' status_set('blocked', msg) return status_set('maintenance', 'Installing etcd.') channel = get_target_etcd_channel() if channel: snap.install('etcd', channel=channel, classic=False)
def install_etcd(): ''' Attempt resource get on the "etcd" and "etcdctl" resources. If no resources are provided attempt to install from the archive only on the 16.04 (xenial) series. ''' if charms.reactive.is_state('etcd.installed'): msg = 'Manual upgrade required. run-action snap-upgrade.' status_set('blocked', msg) return status_set('maintenance', 'Installing etcd.') channel = hookenv.config('channel') # Grab the snap channel from config snap.install('etcd', channel=channel, classic=False)
def install_etcd(): """Attempt resource get on the "etcd" and "etcdctl" resources. If no resources are provided attempt to install from the archive only on the 16.04 (xenial) series.""" if is_state("etcd.installed"): msg = "Manual upgrade required. run-action snap-upgrade." status.blocked(msg) return status.maintenance("Installing etcd.") channel = get_target_etcd_channel() if channel: snap.install("etcd", channel=channel, classic=False)
def install(): opts = layer.options('snap') # supported-architectures is EXPERIMENTAL and undocumented. # It probably should live in the base layer, blocking the charm # during bootstrap if the arch is unsupported. arch = uname()[4] for snapname, snap_opts in opts.items(): supported_archs = snap_opts.pop('supported-architectures', None) if supported_archs and arch not in supported_archs: # Note that this does *not* error. The charm will need to # cope with the snaps it requested never getting installed, # likely by doing its own check on supported-architectures. hookenv.log('Snap {} not supported on {!r} architecture' ''.format(snapname, arch), ERROR) continue installed_flag = 'snap.installed.{}'.format(snapname) if not reactive.is_flag_set(installed_flag): snap.install(snapname, **snap_opts) if data_changed('snap.install.opts', opts): snap.connect_all()
def install_packages(): pin_dse() apt.queue_install(cassandra.get_deb_packages()) if reactive.is_flag_set('apt.queued_installs'): with helpers.autostart_disabled(): if not apt.install_queued(): return # apt layer already left us in a blocked state if cassandra.get_edition() == 'apache-snap': snap.install('cassandra') elif cassandra.get_jre() == 'oracle': tb = fetch_oracle_jre() if tb is None: return install_oracle_jre_tarball(tb) elif cassandra.get_jre() == 'openjdk': subprocess.check_call(['update-java-alternatives', '--jre-headless', '--set', 'java-1.8.0-openjdk-amd64']) reactive.set_flag('cassandra.installed')
def install_snaps(): channel = hookenv.config('channel') hookenv.status_set('maintenance', 'Installing core snap') snap.install('core') hookenv.status_set('maintenance', 'Installing kubectl snap') snap.install('kubectl', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kubelet snap') snap.install('kubelet', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kube-proxy snap') snap.install('kube-proxy', channel=channel, classic=True) calculate_and_store_resource_checksums(checksum_prefix, snap_resources) set_state('kubernetes-worker.snaps.installed') set_state('kubernetes-worker.restart-needed') remove_state('kubernetes-worker.snaps.upgrade-needed') remove_state('kubernetes-worker.snaps.upgrade-specified')
def install_snaps(): channel = hookenv.config("channel") hookenv.status_set("maintenance", "Installing core snap") snap.install("core") hookenv.status_set("maintenance", "Installing kubectl snap") snap.install("kubectl", channel=channel, classic=True) hookenv.status_set("maintenance", "Installing kubelet snap") snap.install("kubelet", channel=channel, classic=True) hookenv.status_set("maintenance", "Installing kube-proxy snap") snap.install("kube-proxy", channel=channel, classic=True) calculate_and_store_resource_checksums(checksum_prefix, snap_resources) set_state("kubernetes-node.snaps.installed") set_state("kubernetes-worker.restart-needed") remove_state("kubernetes-worker.snaps.upgrade-needed") remove_state("kubernetes-worker.snaps.upgrade-specified")
def install_snaps(): """Deliver the e2e and kubectl components from the binary resource stream packages declared in the charm""" channel = hookenv.config("channel") hookenv.status_set("maintenance", "Installing core snap") snap.install("core") hookenv.status_set("maintenance", "Installing kubectl snap") snap.install("kubectl", channel=channel, classic=True) hookenv.status_set("maintenance", "Installing kubernetes-test snap") snap.install("kubernetes-test", channel=channel, classic=True) set_state("kubernetes-e2e.installed")
def install_snaps(): check_resources_for_upgrade_needed() channel = hookenv.config('channel') hookenv.status_set('maintenance', 'Installing kubectl snap') snap.install('kubectl', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kubelet snap') snap.install('kubelet', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kube-proxy snap') snap.install('kube-proxy', channel=channel, classic=True) set_state('kubernetes-worker.snaps.installed') remove_state('kubernetes-worker.snaps.upgrade-needed') remove_state('kubernetes-worker.snaps.upgrade-specified')
def install_snaps(): any_file_changed(get_snap_resource_paths()) channel = hookenv.config('channel') hookenv.status_set('maintenance', 'Installing kubectl snap') snap.install('kubectl', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kubelet snap') snap.install('kubelet', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kube-proxy snap') snap.install('kube-proxy', channel=channel, classic=True) set_state('kubernetes-worker.snaps.installed') set_state('kubernetes-worker.restart-needed') remove_state('kubernetes-worker.snaps.upgrade-needed') remove_state('kubernetes-worker.snaps.upgrade-specified')
def install_snaps(): channel = hookenv.config('channel') hookenv.status_set('maintenance', 'Installing kubectl snap') snap.install('kubectl', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kubelet snap') snap.install('kubelet', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kube-proxy snap') snap.install('kube-proxy', channel=channel, classic=True) calculate_and_store_resource_checksums() set_state('kubernetes-worker.snaps.installed') set_state('kubernetes-worker.restart-needed') remove_state('kubernetes-worker.snaps.upgrade-needed') remove_state('kubernetes-worker.snaps.upgrade-specified')
def install_matrix_ircd(): """Installs matrix IRCd snap.""" if matrix.charm_config.get("enable-ircd"): hookenv.status_set("maintenance", "Installing Matrix IRCd") snap.install("matrix-ircd") hookenv.status_set("active", "Matrix Installed")
def install_matrix_synapse(): """Installs matrix synapse snap.""" hookenv.status_set("maintenance", "Installing Matrix") snap.install("matrix-synapse") hookenv.status_set("active", "Matrix Installed")
def install_kafka(): snap.install('kafka') snap.connect('kafka:removable-media', 'core:removable-media')
def snap_install(): channel = get_target_etcd_channel() snap.install("core") if channel: snap.install("etcd", channel=channel, classic=False) remove_state("etcd.ssl.exported")
def install_snap(self, snapname): """Install specific snap.""" result = snap.install(snapname) hookenv.log("Snap {} install completed: {}".format(snapname, result), hookenv.DEBUG) return result
def install_dex(): ''' Install dex on first run ''' opts = layer.options('dex') snap.install(opts['dex_snap'], channel=config('channel')) open_port(config('auth-port')) invoke_health_message()
def install(): opts = layer.options('snap') for snapname, snap_opts in opts.items(): snap.install(snapname, **snap_opts) if data_changed('snap.install.opts', opts): snap.connect_all()
def snap_install(): channel = hookenv.config('channel') snap.install('core') snap.install('etcd', channel=channel, classic=False)
def install_lxd(): hookenv.status_set('maintenance', 'installing lxd') snap.install('lxd')
def install_snap(self, snapname): """Install specific snap.""" snap.install(snapname)
def snap_install(): channel = get_target_etcd_channel() snap.install('core') if channel: snap.install('etcd', channel=channel, classic=False) remove_state('etcd.ssl.exported')
def install_snap(channel, classic=False): ''' Handle installation of snaps, both from resources and from the snap store. The only indicator we need is classic mode and the channel ''' snap.install('etcd', channel=channel, classic=classic)
def update_dex_channel(): ''' React to channel changes and refresh the dex snap ''' opts = layer.options('dex') snap.install(opts['dex_snap'], channel=config('channel')) invoke_health_message()
def install_snap(): channel = config('channel') # Grab the snap channel from config snap.install('lxd', channel=channel)