def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() configure_installation_source(config('openstack-origin')) status_set('maintenance', 'Installing apt packages') apt_update() apt_install(determine_packages(), fatal=True) if snap_install_requested(): status_set('maintenance', 'Installing keystone snap') # NOTE(thedac) Setting devmode until LP#1719636 is fixed install_os_snaps( get_snaps_install_info_from_origin(['keystone'], config('openstack-origin'), mode='devmode')) post_snap_install() service_stop('snap.keystone.*') else: # unconfigured keystone service will prevent start of haproxy in some # circumstances. make sure haproxy runs. LP #1648396 service_stop('keystone') service_start('haproxy') if run_in_apache(): disable_unused_apache_sites() service_pause('keystone') # call the policy overrides handler which will install any policy overrides maybe_do_policyd_overrides( os_release('keystone'), 'keystone', restart_handler=lambda: service_restart('apache2'))
def do_openstack_pkg_upgrade(self): """Upgrade OpenStack packages and snaps :returns: None """ new_src = self.config[self.source_config_key] new_os_rel = os_utils.get_os_codename_install_source(new_src) hookenv.log('Performing OpenStack upgrade to %s.' % (new_os_rel)) # TODO(jamespage): Deal with deb->snap->deb migrations if os_utils.snap_install_requested() and self.all_snaps: os_utils.install_os_snaps( snaps=os_utils.get_snaps_install_info_from_origin( self.all_snaps, self.config[self.source_config_key], mode=self.snap_mode), refresh=True) os_utils.configure_installation_source(new_src) fetch.apt_update() dpkg_opts = [ '--option', 'Dpkg::Options::=--force-confnew', '--option', 'Dpkg::Options::=--force-confdef', ] fetch.apt_upgrade(options=dpkg_opts, fatal=True, dist=True) fetch.apt_install(packages=self.all_packages, options=dpkg_opts, fatal=True) self.remove_obsolete_packages() self.release = new_os_rel
def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() configure_installation_source(config('openstack-origin')) status_set('maintenance', 'Installing apt packages') apt_update() apt_install(determine_packages(), fatal=True) if snap_install_requested(): status_set('maintenance', 'Installing keystone snap') # NOTE(thedac) Setting devmode until LP#1719636 is fixed install_os_snaps( get_snaps_install_info_from_origin( ['keystone'], config('openstack-origin'), mode='devmode')) post_snap_install() service_stop('snap.keystone.*') else: # unconfigured keystone service will prevent start of haproxy in some # circumstances. make sure haproxy runs. LP #1648396 service_stop('keystone') service_start('haproxy') if run_in_apache(): disable_unused_apache_sites() service_pause('keystone')
def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() configure_installation_source(config('openstack-origin')) status_set('maintenance', 'Installing apt packages') apt_update() apt_install(determine_packages(), fatal=True) if snap_install_requested(): status_set('maintenance', 'Installing keystone snap') # NOTE(thedac) Setting devmode until LP#1719636 is fixed install_os_snaps( get_snaps_install_info_from_origin(['keystone'], config('openstack-origin'), mode='devmode')) post_snap_install() service_stop('snap.keystone.*') else: # unconfigured keystone service will prevent start of haproxy in some # circumstances. make sure haproxy runs. LP #1648396 service_stop('keystone') service_start('haproxy') if run_in_apache(): disable_unused_apache_sites() service_pause('keystone') unison.ensure_user(user=SSH_USER, group=SSH_USER) unison.ensure_user(user=SSH_USER, group=KEYSTONE_USER)
def install(self): """Install packages or snaps related to this charm based on contents of self.packages or self.snaps attribute. """ packages = fetch.filter_installed_packages( self.all_packages) if packages: hookenv.status_set('maintenance', 'Installing packages') fetch.apt_install(packages, fatal=True) if os_utils.snap_install_requested(): if self.all_snaps: hookenv.status_set('maintenance', 'Installing snaps') os_utils.install_os_snaps( os_utils.get_snaps_install_info_from_origin( self.all_snaps, self.config['openstack-origin'], mode=self.snap_mode) ) # AJK: we set this as charms can use it to detect installed state self.set_state('{}-installed'.format(self.name)) self.update_api_ports() hookenv.status_set('maintenance', 'Installation complete - awaiting next status')