diff --git a/docker/services/aodh-evaluator.yaml b/docker/services/aodh-evaluator.yaml index fa1c18a1fb..ed10d94997 100644 --- a/docker/services/aodh-evaluator.yaml +++ b/docker/services/aodh-evaluator.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -122,6 +126,12 @@ outputs: Log files from aodh containers can be found under /var/log/containers/aodh and /var/log/containers/httpd/aodh-api. ignore_errors: true + - name: Stop and disable the aodh-evaluator service + service: + name: openstack-aodh-evaluator + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if aodh_evaluator is deployed command: systemctl is-enabled --quiet openstack-aodh-evaluator diff --git a/docker/services/aodh-listener.yaml b/docker/services/aodh-listener.yaml index b0c8472260..8fd2181c0b 100644 --- a/docker/services/aodh-listener.yaml +++ b/docker/services/aodh-listener.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -122,6 +126,12 @@ outputs: Log files from aodh containers can be found under /var/log/containers/aodh and /var/log/containers/httpd/aodh-api. ignore_errors: true + - name: Stop and disable the aodh-listener service + service: + name: openstack-aodh-listener + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if aodh_listener is deployed command: systemctl is-enabled --quiet openstack-aodh-listener diff --git a/docker/services/aodh-notifier.yaml b/docker/services/aodh-notifier.yaml index ebab2f07cf..f4a130fa54 100644 --- a/docker/services/aodh-notifier.yaml +++ b/docker/services/aodh-notifier.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -122,6 +126,12 @@ outputs: Log files from aodh containers can be found under /var/log/containers/aodh and /var/log/containers/httpd/aodh-api. ignore_errors: true + - name: Stop and disable the aodh-notifier service + service: + name: openstack-aodh-notifier + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if aodh_notifier is deployed command: systemctl is-enabled --quiet openstack-aodh-notifier diff --git a/docker/services/ceilometer-agent-central.yaml b/docker/services/ceilometer-agent-central.yaml index 916fee45ab..c64dc52506 100644 --- a/docker/services/ceilometer-agent-central.yaml +++ b/docker/services/ceilometer-agent-central.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -138,6 +142,12 @@ outputs: Log files from ceilometer containers can be found under /var/log/containers/ceilometer. ignore_errors: true + - name: Stop and disable the ceilometer-central service + service: + name: openstack-ceilometer-central + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if ceilometer_agent_central is deployed command: systemctl is-enabled --quiet openstack-ceilometer-central diff --git a/docker/services/ceilometer-agent-compute.yaml b/docker/services/ceilometer-agent-compute.yaml index 8e15c7893b..e4aa54ad89 100644 --- a/docker/services/ceilometer-agent-compute.yaml +++ b/docker/services/ceilometer-agent-compute.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -109,6 +113,12 @@ outputs: Log files from ceilometer containers can be found under /var/log/containers/ceilometer. ignore_errors: true + - name: Stop and disable the ceilometer-compute service + service: + name: openstack-ceilometer-compute + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if openstack-ceilometer-compute is deployed command: systemctl is-enabled --quiet openstack-ceilometer-compute diff --git a/docker/services/ceilometer-agent-notification.yaml b/docker/services/ceilometer-agent-notification.yaml index 25fde8262b..5a0fa4666b 100644 --- a/docker/services/ceilometer-agent-notification.yaml +++ b/docker/services/ceilometer-agent-notification.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -127,6 +131,12 @@ outputs: Log files from ceilometer containers can be found under /var/log/containers/ceilometer. ignore_errors: true + - name: Stop and disable the ceilometer-notification service + service: + name: openstack-ceilometer-notification + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if ceilometer_agent_notification is deployed command: systemctl is-enabled --quiet openstack-ceilometer-notification diff --git a/docker/services/cinder-api.yaml b/docker/services/cinder-api.yaml index e6d91d3588..86c37d03dc 100644 --- a/docker/services/cinder-api.yaml +++ b/docker/services/cinder-api.yaml @@ -43,6 +43,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -202,6 +206,11 @@ outputs: Log files from cinder containers can be found under /var/log/containers/cinder and /var/log/containers/httpd/cinder-api. ignore_errors: true + - name: remove cinder cron jobs + file: + path: /var/spool/cron/cinder + state: absent + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check is cinder_api is deployed command: systemctl is-enabled openstack-cinder-api diff --git a/docker/services/cinder-scheduler.yaml b/docker/services/cinder-scheduler.yaml index e946c91f10..86e69c60c6 100644 --- a/docker/services/cinder-scheduler.yaml +++ b/docker/services/cinder-scheduler.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -130,6 +134,12 @@ outputs: Log files from cinder containers can be found under /var/log/containers/cinder and /var/log/containers/httpd/cinder-api. ignore_errors: true + - name: Stop and disable the cinder-scheduler service + service: + name: openstack-cinder-scheduler + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if cinder_scheduler is deployed command: systemctl is-enabled openstack-cinder-scheduler diff --git a/docker/services/cinder-volume.yaml b/docker/services/cinder-volume.yaml index de44ade5da..bcab063e0d 100644 --- a/docker/services/cinder-volume.yaml +++ b/docker/services/cinder-volume.yaml @@ -65,6 +65,10 @@ parameters: description: > The Ceph cluster name must be at least 1 character and contain only letters and numbers. + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -175,6 +179,12 @@ outputs: Log files from cinder containers can be found under /var/log/containers/cinder and /var/log/containers/httpd/cinder-api. ignore_errors: true + - name: Stop and disable the cinder-volume service + service: + name: openstack-cinder-volume + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} - name: ensure ceph configurations exist file: path: /etc/ceph diff --git a/docker/services/database/mysql.yaml b/docker/services/database/mysql.yaml index bc2d3be783..fbe6fcf42b 100644 --- a/docker/services/database/mysql.yaml +++ b/docker/services/database/mysql.yaml @@ -48,9 +48,9 @@ parameters: type: string description: Specifies the default CA cert to use if TLS is used for services in the internal network. - MigrateLegacyNeutronDb: + UndercloudUpgrade: type: boolean - description: Used to rename the undercloud database from neutron to ovs_neutron. + description: Flag to indicate undercloud upgrade process is being run. default: false conditions: @@ -249,18 +249,16 @@ outputs: mysql -e "DROP DATABASE \`neutron\`;" fi become: true - when: {get_param: MigrateLegacyNeutronDb} - register: neutron_db_migration + when: {get_param: UndercloudUpgrade} - name: Check if mysql service is deployed command: systemctl is-enabled --quiet mariadb ignore_errors: True register: mariadb_enabled - when: {get_param: MigrateLegacyNeutronDb} + when: {get_param: UndercloudUpgrade} - name: Stop and disable mysql service when undercloud is containerized when: - - {get_param: MigrateLegacyNeutronDb} + - {get_param: UndercloudUpgrade} - mariadb_enabled.rc == 0 - - neutron_db_migration.rc == 0 service: name=mariadb state=stopped enabled=no upgrade_tasks: - name: Check if mysql service is deployed diff --git a/docker/services/glance-api.yaml b/docker/services/glance-api.yaml index 3eec205390..cb801ecb98 100644 --- a/docker/services/glance-api.yaml +++ b/docker/services/glance-api.yaml @@ -87,6 +87,10 @@ parameters: description: > The Ceph cluster name must be at least 1 character and contain only letters and numbers. + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -259,6 +263,12 @@ outputs: file: path: /etc/ceph state: directory + - name: Stop and disable the glance-api service + service: + name: openstack-glance-api + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if glance_api is deployed command: systemctl is-enabled --quiet openstack-glance-api diff --git a/docker/services/gnocchi-metricd.yaml b/docker/services/gnocchi-metricd.yaml index e8d4ae2093..606d1fa0fb 100644 --- a/docker/services/gnocchi-metricd.yaml +++ b/docker/services/gnocchi-metricd.yaml @@ -48,6 +48,10 @@ parameters: description: > The Ceph cluster name must be at least 1 character and contain only letters and numbers. + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -145,6 +149,12 @@ outputs: file: path: /etc/ceph state: directory + - name: Stop and disable the gnocchi-metricd service + service: + name: gnocchi-metricd + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if gnocchi_metricd is deployed command: systemctl is-enabled --quiet openstack-gnocchi-metricd diff --git a/docker/services/gnocchi-statsd.yaml b/docker/services/gnocchi-statsd.yaml index 2b0bc61042..d977573949 100644 --- a/docker/services/gnocchi-statsd.yaml +++ b/docker/services/gnocchi-statsd.yaml @@ -48,6 +48,10 @@ parameters: description: > The Ceph cluster name must be at least 1 character and contain only letters and numbers. + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -145,6 +149,12 @@ outputs: file: path: /etc/ceph state: directory + - name: Stop and disable the gnocchi-statsd service + service: + name: gnocchi-statsd + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if gnocchi_statsd is deployed command: systemctl is-enabled --quiet openstack-gnocchi-statsd diff --git a/docker/services/haproxy.yaml b/docker/services/haproxy.yaml index 62d7a3b5b1..4598416d46 100644 --- a/docker/services/haproxy.yaml +++ b/docker/services/haproxy.yaml @@ -82,6 +82,10 @@ parameters: default: false description: Whether to run config management (e.g. Puppet) in debug mode. type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: puppet_debug_enabled: {get_param: ConfigDebug} @@ -263,5 +267,11 @@ outputs: Log files from the haproxy containers can be found under /var/log/containers/haproxy. ignore_errors: true + - name: Stop and disable the haproxy service + service: + name: haproxy + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} metadata_settings: get_attr: [HAProxyBase, role_data, metadata_settings] diff --git a/docker/services/heat-api.yaml b/docker/services/heat-api.yaml index 8e8845b937..bd26fafe2c 100644 --- a/docker/services/heat-api.yaml +++ b/docker/services/heat-api.yaml @@ -48,6 +48,10 @@ parameters: default: [] description: list of optional environment variables type: comma_delimited_list + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -166,7 +170,14 @@ outputs: - /var/lib/config-data/puppet-generated/heat_api/:/var/lib/kolla/config_files/src:ro environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: {get_attr: [HeatApiLogging, host_prep_tasks]} + host_prep_tasks: + list_concat: + - {get_attr: [HeatApiLogging, host_prep_tasks]} + - - name: remove heat cron jobs + file: + path: /var/spool/cron/heat + state: absent + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if heat_api is deployed command: systemctl is-enabled --quiet openstack-heat-api diff --git a/docker/services/heat-engine.yaml b/docker/services/heat-engine.yaml index 3c8c7335d2..daeb450532 100644 --- a/docker/services/heat-engine.yaml +++ b/docker/services/heat-engine.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -132,7 +136,15 @@ outputs: - /var/lib/config-data/puppet-generated/heat/:/var/lib/kolla/config_files/src:ro environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: {get_attr: [HeatEngineLogging, host_prep_tasks]} + host_prep_tasks: + list_concat: + - {get_attr: [HeatEngineLogging, host_prep_tasks]} + - - name: Stop and disable the heat-engine service + service: + name: openstack-heat-engine + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if heat_engine is deployed command: systemctl is-enabled --quiet openstack-heat-engine diff --git a/docker/services/ironic-conductor.yaml b/docker/services/ironic-conductor.yaml index e5f82c788b..414267c737 100644 --- a/docker/services/ironic-conductor.yaml +++ b/docker/services/ironic-conductor.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -138,6 +142,12 @@ outputs: Log files from ironic containers can be found under /var/log/containers/ironic and /var/log/containers/httpd/ironic-*. ignore_errors: true + - name: Stop and disable the ironic-conductor service + service: + name: openstack-ironic-conductor + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} - name: stat /httpboot stat: path=/httpboot register: stat_httpboot diff --git a/docker/services/ironic-inspector.yaml b/docker/services/ironic-inspector.yaml index dbd908c943..8f8a8c192c 100644 --- a/docker/services/ironic-inspector.yaml +++ b/docker/services/ironic-inspector.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -173,6 +177,12 @@ outputs: Log files from ironic-inspector container can be found under /var/log/containers/ironic-inspector. ignore_errors: true + - name: Stop and disable the ironic-inspector service + service: + name: openstack-ironic-inspector + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - when: step|int == 2 block: diff --git a/docker/services/keepalived.yaml b/docker/services/keepalived.yaml index 5654b0b81f..5ab858d3c7 100644 --- a/docker/services/keepalived.yaml +++ b/docker/services/keepalived.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -113,6 +117,12 @@ outputs: Log files from keepalived containers can be found under /var/log/containers/keepalived. ignore_errors: true + - name: Stop and disable the keepalived service + service: + name: keepalived + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if keepalived is deployed command: systemctl is-enabled --quiet keepalived diff --git a/docker/services/keystone.yaml b/docker/services/keystone.yaml index 20e0d5f9f7..1d716e3221 100644 --- a/docker/services/keystone.yaml +++ b/docker/services/keystone.yaml @@ -49,6 +49,10 @@ parameters: EnableInternalTLS: type: boolean default: false + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -207,7 +211,20 @@ outputs: puppet_tags: 'keystone_config,keystone_domain_config,keystone_endpoint,keystone_identity_provider,keystone_paste_ini,keystone_role,keystone_service,keystone_tenant,keystone_user,keystone_user_role,keystone_domain' step_config: 'include ::tripleo::profile::base::keystone' config_image: *keystone_config_image - host_prep_tasks: {get_attr: [KeystoneLogging, host_prep_tasks]} + host_prep_tasks: + list_concat: + - {get_attr: [KeystoneLogging, host_prep_tasks]} + - - name: Stop and disable the httpd service + service: + name: httpd + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} + - name: remove keystone cron jobs + file: + path: /var/spool/cron/keystone + state: absent + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check for keystone running under apache tags: common diff --git a/docker/services/memcached.yaml b/docker/services/memcached.yaml index a73a84d140..e5a0a106ac 100644 --- a/docker/services/memcached.yaml +++ b/docker/services/memcached.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -116,6 +120,12 @@ outputs: Log files from memcached containers can be found under /var/log/containers/memcached. ignore_errors: true + - name: Stop and disable the memcached service + service: + name: memcached + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if memcached is deployed command: systemctl is-enabled --quiet memcached diff --git a/docker/services/mistral-engine.yaml b/docker/services/mistral-engine.yaml index afd7c419ed..3b0c871178 100644 --- a/docker/services/mistral-engine.yaml +++ b/docker/services/mistral-engine.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -120,6 +124,12 @@ outputs: Log files from mistral containers can be found under /var/log/containers/mistral. ignore_errors: true + - name: Stop and disable the mistral-engine service + service: + name: openstack-mistral-engine + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if mistral engine is deployed command: systemctl is-enabled --quiet openstack-mistral-engine diff --git a/docker/services/mistral-executor.yaml b/docker/services/mistral-executor.yaml index 1c7c0c70e4..f2150ed027 100644 --- a/docker/services/mistral-executor.yaml +++ b/docker/services/mistral-executor.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -128,6 +132,12 @@ outputs: Log files from mistral containers can be found under /var/log/containers/mistral. ignore_errors: true + - name: Stop and disable the mistral-executor service + service: + name: openstack-mistral-executor + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if mistral executor is deployed command: systemctl is-enabled --quiet openstack-mistral-executor diff --git a/docker/services/neutron-api.yaml b/docker/services/neutron-api.yaml index 93fcba644c..eeb611b960 100644 --- a/docker/services/neutron-api.yaml +++ b/docker/services/neutron-api.yaml @@ -51,6 +51,10 @@ parameters: default: [] description: list of optional environment variables type: comma_delimited_list + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -187,7 +191,15 @@ outputs: environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - {} - host_prep_tasks: {get_attr: [NeutronLogging, host_prep_tasks]} + host_prep_tasks: + list_concat: + - {get_attr: [NeutronLogging, host_prep_tasks]} + - - name: Stop and disable the neutron-server service + service: + name: neutron-server + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if neutron_server is deployed command: systemctl is-enabled --quiet neutron-server diff --git a/docker/services/neutron-dhcp.yaml b/docker/services/neutron-dhcp.yaml index 3344056b9d..077266fc58 100644 --- a/docker/services/neutron-dhcp.yaml +++ b/docker/services/neutron-dhcp.yaml @@ -48,6 +48,10 @@ parameters: type: string description: Specifies the default CA cert to use if TLS is used for services in the internal network. + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -164,6 +168,12 @@ outputs: file: path: /var/lib/neutron state: directory + - name: Stop and disable the neutron-dhcp-agent service + service: + name: neutron-dhcp-agent + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if neutron_dhcp_agent is deployed command: systemctl is-enabled --quiet neutron-dhcp-agent diff --git a/docker/services/neutron-l3.yaml b/docker/services/neutron-l3.yaml index 6f4b8cabbb..2033dbbc23 100644 --- a/docker/services/neutron-l3.yaml +++ b/docker/services/neutron-l3.yaml @@ -40,6 +40,10 @@ parameters: description: Mapping of service endpoint -> protocol. Typically set via parameter_defaults in the resource registry. type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -131,6 +135,12 @@ outputs: file: path: /var/lib/neutron state: directory + - name: Stop and disable the neutron-l3-agent service + service: + name: neutron-l3-agent + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if neutron_l3_agent is deployed command: systemctl is-enabled --quiet neutron-l3-agent diff --git a/docker/services/neutron-metadata.yaml b/docker/services/neutron-metadata.yaml index dc4630f3c7..be40d9cb06 100644 --- a/docker/services/neutron-metadata.yaml +++ b/docker/services/neutron-metadata.yaml @@ -36,6 +36,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -124,6 +128,12 @@ outputs: file: path: /var/lib/neutron state: directory + - name: Stop and disable the neutron-metadata-agent service + service: + name: neutron-metadata-agent + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if neutron_metadata_agent is deployed command: systemctl is-enabled --quiet neutron-metadata-agent diff --git a/docker/services/neutron-ovs-agent.yaml b/docker/services/neutron-ovs-agent.yaml index 3dc7d6e4d8..7d63542720 100644 --- a/docker/services/neutron-ovs-agent.yaml +++ b/docker/services/neutron-ovs-agent.yaml @@ -44,6 +44,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -167,7 +171,13 @@ outputs: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS metadata_settings: get_attr: [NeutronOvsAgentBase, role_data, metadata_settings] - host_prep_tasks: {get_attr: [NeutronLogging, host_prep_tasks]} + host_prep_tasks: + - name: Stop and disable the neutron-ovs-agent service + service: + name: neutron-openvswitch-agent + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: list_concat: - get_attr: [NeutronOvsAgentBase, role_data, ovs_upgrade_tasks] diff --git a/docker/services/neutron-plugin-ml2.yaml b/docker/services/neutron-plugin-ml2.yaml index ca3b712502..bf6f0b1de3 100644 --- a/docker/services/neutron-plugin-ml2.yaml +++ b/docker/services/neutron-plugin-ml2.yaml @@ -32,6 +32,10 @@ parameters: default: {} description: Parameters specific to the role type: json + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -67,3 +71,10 @@ outputs: config_image: {get_param: DockerNeutronConfigImage} kolla_config: {} docker_config: {} + host_prep_tasks: + - name: Stop and disable the ironic-neutron-agent service + service: + name: ironic-neutron-agent + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index bdea96f4df..53aa63fe16 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -57,6 +57,10 @@ parameters: description: The password for the nova service and db account type: string hidden: true + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -312,7 +316,14 @@ outputs: - {get_param: DeployIdentifier} metadata_settings: get_attr: [NovaApiBase, role_data, metadata_settings] - host_prep_tasks: {get_attr: [NovaApiLogging, host_prep_tasks]} + host_prep_tasks: + list_concat: + - {get_attr: [NovaApiLogging, host_prep_tasks]} + - - name: remove nova cron jobs + file: + path: /var/spool/cron/nova + state: absent + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if nova_api is deployed command: systemctl is-enabled --quiet openstack-nova-api diff --git a/docker/services/nova-compute.yaml b/docker/services/nova-compute.yaml index d729e46b7f..81435c1664 100644 --- a/docker/services/nova-compute.yaml +++ b/docker/services/nova-compute.yaml @@ -73,6 +73,10 @@ parameters: default: [] description: list of optional en type: comma_delimited_list + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -203,6 +207,12 @@ outputs: file: path: /etc/ceph state: directory + - name: Stop and disable the nova-compute service + service: + name: openstack-nova-compute + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if nova_compute is deployed command: systemctl is-enabled --quiet openstack-nova-compute diff --git a/docker/services/nova-conductor.yaml b/docker/services/nova-conductor.yaml index 61ad10c694..45bf50331c 100644 --- a/docker/services/nova-conductor.yaml +++ b/docker/services/nova-conductor.yaml @@ -44,6 +44,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -126,7 +130,15 @@ outputs: - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} + host_prep_tasks: + list_concat: + - {get_attr: [NovaLogging, host_prep_tasks]} + - - name: Stop and disable the nova-conductor service + service: + name: openstack-nova-conductor + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if nova_conductor is deployed command: systemctl is-enabled --quiet openstack-nova-conductor diff --git a/docker/services/nova-scheduler.yaml b/docker/services/nova-scheduler.yaml index 2895e58b40..a7daadbd7d 100644 --- a/docker/services/nova-scheduler.yaml +++ b/docker/services/nova-scheduler.yaml @@ -40,6 +40,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -122,7 +126,15 @@ outputs: - /run:/run environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} + host_prep_tasks: + list_concat: + - {get_attr: [NovaLogging, host_prep_tasks]} + - - name: Stop and disable the nova-scheduler service + service: + name: openstack-nova-scheduler + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if nova_scheduler is deployed command: systemctl is-enabled --quiet openstack-nova-scheduler diff --git a/docker/services/rabbitmq.yaml b/docker/services/rabbitmq.yaml index af1bdfb7b1..ffc919eccd 100644 --- a/docker/services/rabbitmq.yaml +++ b/docker/services/rabbitmq.yaml @@ -48,6 +48,10 @@ parameters: type: string description: Specifies the default CA cert to use if TLS is used for services in the internal network. + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -224,6 +228,12 @@ outputs: Log files from rabbitmq containers can be found under /var/log/containers/rabbitmq. ignore_errors: true + - name: Stop and disable the rabbitmq-server service + service: + name: rabbitmq-server + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check if rabbitmq server is deployed command: systemctl is-enabled --quiet rabbitmq-server diff --git a/docker/services/swift-proxy.yaml b/docker/services/swift-proxy.yaml index d507ed2c01..7d4d7a587d 100644 --- a/docker/services/swift-proxy.yaml +++ b/docker/services/swift-proxy.yaml @@ -47,6 +47,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: @@ -240,6 +244,19 @@ outputs: src: /var/log/swift dest: /var/log/containers/swift state: link + - name: Stop and disable the swift proxy services + service: + name: "{{ item }}" + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} + with_items: + - openstack-swift-account + - openstack-swift-account-reaper + - openstack-swift-container + - openstack-swift-container-sync + - openstack-swift-container-updater + - openstack-swift-proxy upgrade_tasks: - name: Check if swift-proxy or swift-object-expirer are deployed command: systemctl is-enabled --quiet "{{ item }}" diff --git a/docker/services/swift-storage.yaml b/docker/services/swift-storage.yaml index d118088643..fdba400976 100644 --- a/docker/services/swift-storage.yaml +++ b/docker/services/swift-storage.yaml @@ -57,6 +57,10 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false resources: @@ -481,6 +485,17 @@ outputs: template: 'DEVICE' for_each: DEVICE: {get_param: SwiftRawDisks} + - name: Stop and disable the swift storage services + service: + name: "{{ item }}" + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} + with_items: + - openstack-swift-object + - openstack-swift-object-expirer + - openstack-swift-object-reconstructor + - openstack-swift-object-updater upgrade_tasks: - name: Check if swift storage services are deployed command: systemctl is-enabled --quiet "{{ item }}" diff --git a/docker/services/undercloud-upgrade.yaml b/docker/services/undercloud-upgrade.yaml new file mode 100644 index 0000000000..8777bfe758 --- /dev/null +++ b/docker/services/undercloud-upgrade.yaml @@ -0,0 +1,52 @@ +heat_template_version: queens + +description: > + Upgrade a non-containerized undercloud to a containerized undercloud. + +parameters: + ServiceData: + default: {} + description: Dictionary packing service data + type: json + ServiceNetMap: + default: {} + description: Mapping of service_name -> network name. Typically set + via parameter_defaults in the resource registry. This + mapping overrides those in ServiceNetMapDefaults. + type: json + DefaultPasswords: + default: {} + type: json + RoleName: + default: '' + description: Role name on which the service is applied + type: string + RoleParameters: + default: {} + description: Parameters specific to the role + type: json + EndpointMap: + default: {} + description: Mapping of service endpoint -> protocol. Typically set + via parameter_defaults in the resource registry. + type: json + +outputs: + role_data: + description: Role data for the TripleO Undercloud Upgrade service. + value: + service_name: undercloud_upgrade + config_settings: {} + external_deploy_tasks: + - name: upgrade all packages + yum: + name: '*' + state: latest + when: step|int == 1 + docker_config: {} + kolla_config: {} + puppet_config: + config_volume: '' + step_config: '' + config_image: '' + upgrade_tasks: [] diff --git a/docker/services/zaqar.yaml b/docker/services/zaqar.yaml index 3f9d6b6335..09c8c8f020 100644 --- a/docker/services/zaqar.yaml +++ b/docker/services/zaqar.yaml @@ -43,6 +43,10 @@ parameters: EnableInternalTLS: type: boolean default: false + UndercloudUpgrade: + type: boolean + description: Flag to indicate undercloud upgrade process is being run. + default: false conditions: zaqar_management_store_sqlalchemy: {equals : [{get_param: ZaqarManagementStore}, 'sqlalchemy']} @@ -194,6 +198,12 @@ outputs: Log files from zaqar containers can be found under /var/log/containers/zaqar and /var/log/containers/httpd/zaqar. ignore_errors: true + - name: Stop and disable the zaqar-server service + service: + name: openstack-zaqar@1 + state: stopped + enabled: no + when: {get_param: UndercloudUpgrade} upgrade_tasks: - name: Check for zaqar running under apache tags: common diff --git a/environments/lifecycle/undercloud-upgrade-prepare.yaml b/environments/lifecycle/undercloud-upgrade-prepare.yaml new file mode 100644 index 0000000000..9ac12119d6 --- /dev/null +++ b/environments/lifecycle/undercloud-upgrade-prepare.yaml @@ -0,0 +1,8 @@ +# A Heat environment file that can be used to upgrade a non-containerized undercloud +# to a containerized undercloud. + +resource_registry: + OS::TripleO::Services::UndercloudUpgrade: ../../docker/services/undercloud-upgrade.yaml + +parameter_defaults: + UndercloudUpgrade: true diff --git a/environments/undercloud.yaml b/environments/undercloud.yaml index bbe530b3fb..0d4a67aa6e 100644 --- a/environments/undercloud.yaml +++ b/environments/undercloud.yaml @@ -83,7 +83,6 @@ parameter_defaults: NeutronTypeDrivers: ['local','flat','vlan','gre','vxlan'] NeutronVniRanges: '10:100' NeutronPortQuota: '-1' - MigrateLegacyNeutronDb: true SwiftCorsAllowedOrigin: '*' # A list of static routes for the control plane network. Ensure traffic to # nodes on remote control plane networks use the correct network path. diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml index e0f467b2d2..a0b0dc0acf 100644 --- a/overcloud-resource-registry-puppet.j2.yaml +++ b/overcloud-resource-registry-puppet.j2.yaml @@ -242,6 +242,7 @@ resource_registry: OS::TripleO::Services::Ipsec: OS::Heat::None OS::TripleO::Services::Rhsm: OS::Heat::None OS::TripleO::Services::MasqueradeNetworks: OS::Heat::None + OS::TripleO::Services::UndercloudUpgrade: OS::Heat::None OS::TripleO::Services::Collectd: OS::Heat::None OS::TripleO::LoggingConfiguration: puppet/services/logging/fluentd-config.yaml OS::TripleO::Services::ManilaApi: OS::Heat::None diff --git a/releasenotes/notes/neutron_db_rename-bbfbce1c58cadc84.yaml b/releasenotes/notes/neutron_db_rename-bbfbce1c58cadc84.yaml index 7ccb05456b..e39813e872 100644 --- a/releasenotes/notes/neutron_db_rename-bbfbce1c58cadc84.yaml +++ b/releasenotes/notes/neutron_db_rename-bbfbce1c58cadc84.yaml @@ -3,5 +3,3 @@ upgrade: - | When the undercloud was not containerized, the neutron database name was called neutron. When we upgrade to a containerized undercloud, the database name is called ovs_neutron. - We introduced MigrateLegacyNeutronDb (false by default in the service but true when - the undercloud is containerized) that will rename the database during host_prep_tasks. diff --git a/releasenotes/notes/undercloud_upgrade-b69ed7d5d002d6ae.yaml b/releasenotes/notes/undercloud_upgrade-b69ed7d5d002d6ae.yaml new file mode 100644 index 0000000000..11b61fee23 --- /dev/null +++ b/releasenotes/notes/undercloud_upgrade-b69ed7d5d002d6ae.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + The Undercloud upgrade is now done via host_prep_tasks in the docker services, driven + by tripleoclient when containerizing the Undercloud. + Note that the crontabs that were not managed by Puppet (e.g. custom crontabs) for the + openstack services (cinder, heat, keystone and nova) will be removed and need to be + containerized or re-added manually after the upgrade. diff --git a/roles/Undercloud.yaml b/roles/Undercloud.yaml index 58418d9219..f483a2b6bc 100644 --- a/roles/Undercloud.yaml +++ b/roles/Undercloud.yaml @@ -74,5 +74,6 @@ - OS::TripleO::Services::UndercloudRedis - OS::TripleO::Services::UndercloudHAProxy - OS::TripleO::Services::UndercloudKeepalived + - OS::TripleO::Services::UndercloudUpgrade - OS::TripleO::Services::Zaqar - OS::TripleO::Services::Tempest diff --git a/roles_data_undercloud.yaml b/roles_data_undercloud.yaml index 6161114ff7..c33917ac71 100644 --- a/roles_data_undercloud.yaml +++ b/roles_data_undercloud.yaml @@ -77,6 +77,7 @@ - OS::TripleO::Services::UndercloudRedis - OS::TripleO::Services::UndercloudHAProxy - OS::TripleO::Services::UndercloudKeepalived + - OS::TripleO::Services::UndercloudUpgrade - OS::TripleO::Services::Zaqar - OS::TripleO::Services::Tempest