heat_template_version: wallaby 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. Use parameter_merge_strategies to merge it with the defaults. 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 SkipRhelEnforcement: default: false description: Whether to avoid or not RHEL/OSP policies enforcement on Red Hat. Mainly for CI purpose. It shouldn't matter on other distributions where it's disabled in the role. Set to true to skip the enforcement. type: boolean DnfStreams: default: [] description: List of streams to be configured before updating packages. Each list element contains a dictionary with the following values defined module[mandatory], stream[mandatory], distribution_version[mandatory] and profile[optional]. If the profile is not specified 'common' will be used instead. type: json tags: - role_specific outputs: role_data: description: Role data for the TripleO Undercloud Upgrade service. value: service_name: undercloud_upgrade config_settings: {} deploy_steps_tasks: [] docker_config: {} kolla_config: {} puppet_config: {} upgrade_tasks: - name: Enforce RHOSP rules regarding subscription. include_role: name: tripleo_redhat_enforce vars: skip_rhel_enforcement: {get_param: SkipRhelEnforcement} when: - step|int == 0 - ansible_facts['distribution'] == 'RedHat' - not (skip_rhel_enforcement | bool) - name: Ensure DNF modules have the right stream enabled vars: dnf_module_list: {get_param: DnfStreams} tripleo_dnf_stream: name: "{{ item.module }}:{{ item.stream }}" state: enabled loop: "{{ dnf_module_list|list }}" when: - step|int == 0 - dnf_module_list|length > 0 - item.distribution_version is defined - ansible_facts['distribution_major_version'] is version(item.distribution_version, '==') - name: Clean up Nova containers when: step|int == 0 block: - name: Stop nova containers import_role: name: tripleo_container_stop vars: tripleo_containers_to_stop: &nova_containers - nova_api - nova_api_cron - nova_conductor - nova_scheduler - placement_api - nova_compute - name: Remove nova containers import_role: name: tripleo_container_rm vars: containers_to_rm: *nova_containers - name: Remove one-off nova init-containers import_role: name: tripleo_container_rm vars: containers_to_rm: - nova_api_db_sync - nova_api_init_logs - nova_api_map_cell0 - nova_api_ensure_default_cell - nova_statedir_owner - nova_wait_for_compute_service - nova_wait_for_api_service - nova_db_sync - placement_api_db_sync - placement_wait_for_service - placement_init_log - name: Test if ironic introspection ran when: - step|int == 1 stat: path: '/var/lib/tripleo/ironic_inspector_migrate_data' register: ironic_inspector_migrate_statefile - name: migrate existing introspection data shell: > {{ container_cli }} exec -u root ironic_inspector ironic-inspector-migrate-data --from swift --to database --config-file /etc/ironic-inspector/inspector.conf become: true register: ironic_inspector_migrate_data_result when: - step|int == 1 - not ironic_inspector_migrate_statefile.stat.exists|bool failed_when: - ironic_inspector_migrate_data_result.rc is defined # do not fail in dry run mode - ironic_inspector_migrate_data_result.rc not in [0, 125] # ignore if container not running - name: Ensure we can create state files in /var/lib/tripleo file: path: '/var/lib/tripleo' state: directory when: - step|int == 1 - ironic_inspector_migrate_data_result.rc is defined # do not fail in dry run mode - ironic_inspector_migrate_data_result.rc in [0, 125] # ignore if container not running - name: Create introspection passed statefile file: path: '/var/lib/tripleo/ironic_inspector_migrate_data' state: touch when: - step|int == 1 - ironic_inspector_migrate_data_result.rc is defined # do not fail in dry run mode - ironic_inspector_migrate_data_result.rc in [0, 125] # ignore if container not running # Keepalived was removed and the VIPs are now deployed by # os-net-config. # When Keepalived is stopped, it brings down the VIPs which is # problematic since it'll remove the resources created by os-net-config # so let's teardown keepalived in the upgrade tasks here and later # during the deploy the os-net-config tool will re-create the VIPs. # Doing it at step 5 so upgrade steps which need API access still work. - name: Remove keepalived container include_role: name: tripleo_container_rm vars: tripleo_container_cli: "{{ container_cli }}" tripleo_containers_to_rm: - keepalived when: - step|int == 5