diff --git a/common/deploy-steps-tasks-step-1.yaml b/common/deploy-steps-tasks-step-1.yaml index 223f813f74..75504c0e0a 100644 --- a/common/deploy-steps-tasks-step-1.yaml +++ b/common/deploy-steps-tasks-step-1.yaml @@ -275,13 +275,13 @@ - name: gather facts needed by role setup: gather_subset: "!min,python" - when: ansible_python is not defined + when: ansible_facts['python'] is not defined tags: - container_config_tasks - name: set python_cmd set_fact: - python_cmd: "python{{ ansible_python.version.major }}" + python_cmd: "python{{ ansible_facts['python']['version']['major'] }}" cacheable: true when: python_cmd is not defined tags: diff --git a/common/deploy-steps-tasks.yaml b/common/deploy-steps-tasks.yaml index b4b81f512a..1290a35d46 100644 --- a/common/deploy-steps-tasks.yaml +++ b/common/deploy-steps-tasks.yaml @@ -227,7 +227,7 @@ # Bootstrap tasks - run any tasks that have been defined ######################################################## -- name: "Clean container_puppet_tasks for {{ansible_hostname | lower}} step {{step}}" +- name: "Clean container_puppet_tasks for {{ansible_facts['hostname'] | lower}} step {{step}}" become: true file: path: /var/lib/container-puppet/container-puppet-tasks{{step}}.json @@ -235,11 +235,11 @@ tags: - container_config_tasks -- name: Calculate container_puppet_tasks for {{ansible_hostname | lower}} step {{step}} +- name: Calculate container_puppet_tasks for {{ansible_facts['hostname'] | lower}} step {{step}} set_fact: "{{'host_container_puppet_tasks_' ~ step}}": "{{lookup('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | union([item])}}" loop: "{{container_puppet_tasks.get('step_' ~ step, [])}}" - when: (groups[item.service_name] | default ([]) | map('extract', hostvars, 'inventory_hostname') | sort | first | lower) == ansible_hostname | lower + when: (groups[item.service_name] | default ([]) | map('extract', hostvars, 'inventory_hostname') | sort | first | lower) == ansible_facts['hostname'] | lower vars: container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}" tags: diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index ba61deb056..de22782807 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -1119,9 +1119,9 @@ outputs: loop_control: loop_var: step tags: always - # we use ansible_hostname to determine if the host is alive + # we use ansible_facts['hostname'] to determine if the host is alive # or not. - when: ansible_hostname is defined + when: ansible_facts['hostname'] is defined # We don't want to run the scale tasks on dead nodes, to allow # the operator to scale down the cloud no matter the state of # the servers. @@ -1132,9 +1132,9 @@ outputs: msg: "Node is unreachable. No scale tasks will be run." ignore_errors: True tags: always - # we use ansible_hostname to determine if the host is alive + # we use ansible_facts['hostname'] to determine if the host is alive # or not. - when: ansible_hostname is not defined + when: ansible_facts['hostname'] is not defined tags: - scale post_update_steps_tasks: | diff --git a/common/generate-config-tasks.yaml b/common/generate-config-tasks.yaml index a3dd7c63d1..866b8995b4 100644 --- a/common/generate-config-tasks.yaml +++ b/common/generate-config-tasks.yaml @@ -20,7 +20,7 @@ MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet | default(true)}}' CONTAINER_LOG_STDOUT_PATH: "{{ container_log_stdout_path }}" CONTAINER_HEALTHCHECK_DISABLED: "{{ container_healthcheck_disabled }}" - SHORT_HOSTNAME: "{{ ansible_hostname | lower }}" + SHORT_HOSTNAME: "{{ ansible_facts['hostname'] | lower }}" check_mode: no register: generate_config_async_result @@ -64,7 +64,7 @@ net_host: true no_archive: false puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet.json" - short_hostname: "{{ ansible_hostname | lower }}" + short_hostname: "{{ ansible_facts['hostname'] | lower }}" step: "{{ step }}" - name: "Manage Puppet containers (generate config) for step {{ step }} with tripleo-ansible" diff --git a/common/host-container-puppet-tasks.yaml b/common/host-container-puppet-tasks.yaml index fc569d7f8e..de15cdff9c 100644 --- a/common/host-container-puppet-tasks.yaml +++ b/common/host-container-puppet-tasks.yaml @@ -1,4 +1,4 @@ -- name: Write container-puppet-tasks json file for {{ansible_hostname | lower}} step {{step}} +- name: Write container-puppet-tasks json file for {{ansible_facts['hostname'] | lower}} step {{step}} no_log: True copy: content: "{{lookup ('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | to_nice_json}}" @@ -28,7 +28,7 @@ CONTAINER_CLI: "{{ container_cli }}" DEBUG: "{{ docker_puppet_debug }}" MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet}}' - SHORT_HOSTNAME: "{{ ansible_hostname | lower }}" + SHORT_HOSTNAME: "{{ ansible_facts['hostname'] | lower }}" PROCESS_COUNT: "{{ docker_puppet_process_count }}" register: bootstrap_tasks_async_result no_log: true @@ -66,7 +66,7 @@ net_host: true no_archive: true puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet-tasks{{ step }}.json" - short_hostname: "{{ ansible_hostname | lower }}" + short_hostname: "{{ ansible_facts['hostname'] | lower }}" step: "{{ step }}" - name: "Manage Puppet containers (bootstrap tasks) for step {{ step }} with tripleo-ansible" diff --git a/deployment/ceph-ansible/ceph-base.yaml b/deployment/ceph-ansible/ceph-base.yaml index 880a630ce5..be60dbb5a8 100644 --- a/deployment/ceph-ansible/ceph-base.yaml +++ b/deployment/ceph-ansible/ceph-base.yaml @@ -617,7 +617,7 @@ outputs: state: present when: - step|int == 1 - - ansible_distribution_major_version == '8' + - ansible_facts['distribution_major_version'] == '8' post_upgrade_tasks: [] puppet_config: config_image: '' diff --git a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml index f52283bf41..344b9634f1 100644 --- a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml @@ -290,7 +290,7 @@ outputs: cinder_backup_pcs_res: "{{cinder_backup_pcs_res_result.rc == 0}}" - name: set is_cinder_backup_bootstrap_node fact tags: common - set_fact: is_cinder_backup_bootstrap_node={{cinder_backup_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_cinder_backup_bootstrap_node={{cinder_backup_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} - name: Update cinder_backup pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml index e31eba73e0..e3bafcc2db 100644 --- a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml @@ -270,7 +270,7 @@ outputs: cinder_volume_pcs_res: "{{cinder_volume_pcs_res_result.rc == 0}}" - name: set is_cinder_volume_bootstrap_node fact tags: common - set_fact: is_cinder_volume_bootstrap_node={{cinder_volume_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_cinder_volume_bootstrap_node={{cinder_volume_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} - name: Update cinder_volume pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/database/mysql-pacemaker-puppet.yaml b/deployment/database/mysql-pacemaker-puppet.yaml index efa0e6d84b..9285881d76 100644 --- a/deployment/database/mysql-pacemaker-puppet.yaml +++ b/deployment/database/mysql-pacemaker-puppet.yaml @@ -438,7 +438,7 @@ outputs: galera_pcs_res: "{{galera_pcs_res_result.rc == 0}}" - name: set is_mysql_bootstrap_node fact tags: common - set_fact: is_mysql_bootstrap_node={{mysql_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_mysql_bootstrap_node={{mysql_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} - name: Update galera pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/database/redis-pacemaker-puppet.yaml b/deployment/database/redis-pacemaker-puppet.yaml index 65700df7a7..f56c77f990 100644 --- a/deployment/database/redis-pacemaker-puppet.yaml +++ b/deployment/database/redis-pacemaker-puppet.yaml @@ -356,7 +356,7 @@ outputs: - name: Set upgrade redis facts set_fact: redis_pcs_res: "{{redis_pcs_res_result.rc == 0}}" - is_redis_bootstrap_node: "{{redis_short_bootstrap_node_name|lower == ansible_hostname|lower}}" + is_redis_bootstrap_node: "{{redis_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}}" - name: Update redis-bundle pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/deprecated/kubernetes/kubernetes-master-baremetal-ansible.yaml b/deployment/deprecated/kubernetes/kubernetes-master-baremetal-ansible.yaml index 3d8427a1b3..4bef9fb996 100644 --- a/deployment/deprecated/kubernetes/kubernetes-master-baremetal-ansible.yaml +++ b/deployment/deprecated/kubernetes/kubernetes-master-baremetal-ansible.yaml @@ -111,7 +111,7 @@ outputs: kube-master: hosts: {% for host in groups['kubernetes_master'] -%} - {{ hostvars.raw_get(host)['ansible_hostname'] }}: + {{ hostvars.raw_get(host)['ansible_facts']['hostname'] }}: ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }} ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }} ansible_become: true @@ -121,7 +121,7 @@ outputs: hosts: {% for host in groups['kubernetes_worker'] -%} - {{ hostvars.raw_get(host)['ansible_hostname'] }}: + {{ hostvars.raw_get(host)['ansible_facts']['hostname'] }}: ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }} ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }} ansible_become: true diff --git a/deployment/haproxy/haproxy-pacemaker-puppet.yaml b/deployment/haproxy/haproxy-pacemaker-puppet.yaml index 7a9a022905..f90718095b 100644 --- a/deployment/haproxy/haproxy-pacemaker-puppet.yaml +++ b/deployment/haproxy/haproxy-pacemaker-puppet.yaml @@ -336,7 +336,7 @@ outputs: block: &haproxy_update_upgrade_facts - name: set is_haproxy_bootstrap_node fact tags: common - set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} when: - haproxy_short_bootstrap_node_name|default(false) - name: Mount TLS cert if needed @@ -447,7 +447,7 @@ outputs: - name: Set upgrade haproxy facts set_fact: haproxy_pcs_res: "{{haproxy_pcs_res_result.rc == 0}}" - is_haproxy_bootstrap_node: "{{haproxy_short_bootstrap_node_name|lower == ansible_hostname|lower}}" + is_haproxy_bootstrap_node: "{{haproxy_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}}" - name: Update haproxy pcs resource bundle for new container image when: diff --git a/deployment/haproxy/haproxy-public-tls-inject.yaml b/deployment/haproxy/haproxy-public-tls-inject.yaml index a4f8d0f49a..9f62ca2bd6 100644 --- a/deployment/haproxy/haproxy-public-tls-inject.yaml +++ b/deployment/haproxy/haproxy-public-tls-inject.yaml @@ -85,7 +85,7 @@ outputs: path: "{{cert_path}}" - name: set is_haproxy_bootstrap_node fact - set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name | lower == ansible_hostname | lower}} + set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name | lower == ansible_facts['hostname'] | lower}} when: - haproxy_short_bootstrap_node_name|default(false) diff --git a/deployment/ipa/ipaclient-baremetal-ansible.yaml b/deployment/ipa/ipaclient-baremetal-ansible.yaml index 52ab335ba6..a696c3931b 100644 --- a/deployment/ipa/ipaclient-baremetal-ansible.yaml +++ b/deployment/ipa/ipaclient-baremetal-ansible.yaml @@ -214,6 +214,6 @@ outputs: tripleo_ipa_server_metadata: "{{ hostvars[item]['service_metadata_settings'] | to_json }}" loop: "{{ groups.certmonger_user }}" environment: - IPA_USER: "nova/{{ ansible_fqdn }}" + IPA_USER: "nova/{{ ansible_facts['fqdn'] }}" KRB5_CLIENT_KTNAME: "/etc/novajoin/krb5.keytab" IPA_HOST: "{{ ipa_server_name }}" diff --git a/deployment/ipa/ipaservices-baremetal-ansible.yaml b/deployment/ipa/ipaservices-baremetal-ansible.yaml index 9d916ad322..cfb1a88a3d 100644 --- a/deployment/ipa/ipaservices-baremetal-ansible.yaml +++ b/deployment/ipa/ipaservices-baremetal-ansible.yaml @@ -116,9 +116,9 @@ outputs: if: - idm_server_provided - IPA_HOST: {get_param: IdMServer} - IPA_USER: "nova/{{ ansible_fqdn }}" + IPA_USER: "nova/{{ ansible_facts['fqdn'] }}" KRB5_CLIENT_KTNAME: {get_param: IdMNovaKeytab} - - IPA_USER: "nova/{{ ansible_fqdn }}" + - IPA_USER: "nova/{{ ansible_facts['fqdn'] }}" KRB5_CLIENT_KTNAME: {get_param: IdMNovaKeytab} deploy_steps_tasks: - name: enroll the node as an ipa client diff --git a/deployment/manila/manila-share-pacemaker-puppet.yaml b/deployment/manila/manila-share-pacemaker-puppet.yaml index 0339e86746..77637b7dc0 100644 --- a/deployment/manila/manila-share-pacemaker-puppet.yaml +++ b/deployment/manila/manila-share-pacemaker-puppet.yaml @@ -261,7 +261,7 @@ outputs: manila_share_pcs_res: "{{manila_share_pcs_res_result.rc == 0}}" - name: set is_manila_share_bootstrap_node fact tags: common - set_fact: is_manila_share_bootstrap_node={{manila_share_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_manila_share_bootstrap_node={{manila_share_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} - name: Update openstack-manila-share pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index eb2e0247b0..8cb1614ba6 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -1164,7 +1164,7 @@ outputs: register: iha_nodes - name: If instance HA is enabled on the node activate the evacuation completed check file: path=/var/lib/nova/instanceha/enabled state=touch - when: iha_nodes.stdout|lower is search('"'+ansible_hostname|lower+'"') + when: iha_nodes.stdout|lower is search('"'+ansible_facts['hostname']|lower+'"') - name: Is irqbalance enabled set_fact: compute_irqbalance_disabled: {get_attr: [RoleParametersValue, value, compute_disable_irqbalance]} @@ -1253,21 +1253,21 @@ outputs: name: qemu-kvm-common-ev state: present when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version == '7' + - ansible_facts['distribution'] == 'CentOS' + - ansible_facts['distribution_major_version'] is version('7', '==') - name: make sure package providing ksmtuned is installed (RHEL7) package: name: qemu-kvm-common-rhev state: present when: - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '7' + - ansible_facts['distribution'] == 'RedHat' + - ansible_facts['distribution_major_version'] is version('7', '==') - name: make sure package providing ksmtuned is installed (RHEL8 or CentOS8) package: name: qemu-kvm-common state: present when: - - ansible_distribution_major_version == '8' + - ansible_facts['distribution_major_version'] is version('8', '==') - name: enable ksmtunded service: name: "{{ item }}" @@ -1410,13 +1410,13 @@ outputs: is_additional_cell: {get_param: NovaAdditionalCell} - name: Set fact for nova_compute services set_fact: - nova_compute_service: "{{ nova_compute_service_result.stdout | from_yaml | selectattr('Host', 'match', ansible_fqdn ~ '.*') | list }}" + nova_compute_service: "{{ nova_compute_service_result.stdout | from_yaml | selectattr('Host', 'match', ansible_facts['fqdn'] ~ '.*') | list }}" delegate_to: localhost check_mode: no - name: Check search output fail: msg: >- - Found multiple `{{ ansible_fqdn }}`, which is unexpected. + Found multiple `{{ ansible_facts['fqdn'] }}`, which is unexpected. This means that the FQDN of the selected device to disable is either wrong or is sharing a name with another host, which is also wrong. Please correct this issue before continuing. Nova diff --git a/deployment/nova/novajoin-container-puppet.yaml b/deployment/nova/novajoin-container-puppet.yaml index ec50b10e23..0a2e16dce2 100644 --- a/deployment/nova/novajoin-container-puppet.yaml +++ b/deployment/nova/novajoin-container-puppet.yaml @@ -231,8 +231,8 @@ outputs: # openssl-perl is installed which provides /etc/pki/CA on RHEL8 - name: Ensure openssl-perl package is present on RHEL8 when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version == '8' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] is version('8', '==') package: name: openssl-perl state: present @@ -258,6 +258,6 @@ outputs: creates: /etc/ipa/default.conf when: ipa_otp != '' - name: Request kerberos keytab - shell: "/usr/bin/kinit -kt /etc/krb5.keytab && ipa-getkeytab -s $(grep xmlrpc_uri /etc/ipa/default.conf | cut -d/ -f3) -p nova/{{ ansible_nodename }} -k /etc/novajoin/krb5.keytab" + shell: "/usr/bin/kinit -kt /etc/krb5.keytab && ipa-getkeytab -s $(grep xmlrpc_uri /etc/ipa/default.conf | cut -d/ -f3) -p nova/{{ ansible_facts['nodename'] }} -k /etc/novajoin/krb5.keytab" args: creates: /etc/novajoin/krb5.keytab diff --git a/deployment/octavia/octavia-deployment-config.j2.yaml b/deployment/octavia/octavia-deployment-config.j2.yaml index 1315cfc1f2..dc7d979284 100644 --- a/deployment/octavia/octavia-deployment-config.j2.yaml +++ b/deployment/octavia/octavia-deployment-config.j2.yaml @@ -303,7 +303,7 @@ outputs: {%- if 'octavia_' ~ octavia_groups %} {% for host in groups['octavia_' ~ octavia_group] -%} - {{ hostvars.raw_get(host)['ansible_hostname'] | lower}}: + {{ hostvars.raw_get(host)['ansible_facts']['hostname'] | lower}}: ansible_user: {{ hostvars.raw_get(host)['ansible_ssh_user'] | default('heat-admin') }} ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) | lower }} canonical_hostname: {{ hostvars.raw_get(host)['canonical_hostname'] | default(host) | lower }} @@ -316,7 +316,7 @@ outputs: Undercloud: hosts: {% for host in groups['Undercloud'] -%} - {{ hostvars.raw_get(host)['ansible_hostname'] | lower}}: + {{ hostvars.raw_get(host)['ansible_facts']['hostname'] | lower}}: ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) | lower }} ansible_become: false ansible_connection: local diff --git a/deployment/octavia/octavia-worker-container-puppet.yaml b/deployment/octavia/octavia-worker-container-puppet.yaml index 479e3b48f5..3c0aed1800 100644 --- a/deployment/octavia/octavia-worker-container-puppet.yaml +++ b/deployment/octavia/octavia-worker-container-puppet.yaml @@ -151,7 +151,7 @@ outputs: - python2-openstackclient - openssl state: present - when: ansible_distribution_major_version is version(8, '<') + when: ansible_facts['distribution_major_version'] is version(8, '<') - name: Ensure packages required for configuring octavia are present for CentOS/RHEL 8 package: @@ -160,7 +160,7 @@ outputs: - python3-openstackclient - openssl state: present - when: ansible_distribution_major_version is version(8, '>=') + when: ansible_facts['distribution_major_version'] is version(8, '>=') when: {get_param: EnablePackageInstall} - name: enable virt_sandbox_use_netlink for healthcheck seboolean: diff --git a/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml b/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml index e6e5877f1d..99010d5d18 100644 --- a/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml +++ b/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml @@ -355,7 +355,7 @@ outputs: - name: Update ovn-dbs-bundle resource to use pcmklatest tag image if not used when: - step|int == 5 - - ovn_dbs_short_bootstrap_node_name|lower == ansible_hostname|lower + - ovn_dbs_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower block: - name: Get the present image used by ovn-dbs-bundle shell: "pcs resource config ovn-dbs-bundle | grep -Eo 'image=[^ ]+' | awk -F= '{print $2;}'" @@ -415,7 +415,7 @@ outputs: - name: Update ovn_dbs pcs resource bundle for new container image when: - step|int == 1 - - ovn_dbs_short_bootstrap_node_name|lower == ansible_hostname|lower + - ovn_dbs_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower - ovn_dbs_pcs_res|bool - ovn_dbs_image_current != ovn_dbs_image_latest block: @@ -497,7 +497,7 @@ outputs: - name: Restart ovn-dbs service (pacemaker) when: - step|int == 1 - - ovn_dbs_short_bootstrap_node_name|lower == ansible_hostname|lower + - ovn_dbs_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower pacemaker_resource: resource: ovn-dbs-bundle state: restart diff --git a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml index bd48da2066..0b9c7d0b45 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-notify-pacemaker-puppet.yaml @@ -335,7 +335,7 @@ outputs: set_fact: rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" - name: set is_notify_rabbitmq_bootstrap_node fact - set_fact: is_notify_rabbitmq_bootstrap_node={{oslo_messaging_notify_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_notify_rabbitmq_bootstrap_node={{oslo_messaging_notify_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} - name: Update rabbitmq-bundle pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml index 54a2ee4df2..9c2c5e7cbb 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-pacemaker-puppet.yaml @@ -336,7 +336,7 @@ outputs: rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" - name: set is_rabbitmq_bootstrap_node fact tags: common - set_fact: is_rabbitmq_bootstrap_node={{rabbitmq_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_rabbitmq_bootstrap_node={{rabbitmq_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} - name: Update rabbitmq-bundle pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml index d1e597a027..a7b677b530 100644 --- a/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml +++ b/deployment/rabbitmq/rabbitmq-messaging-rpc-pacemaker-puppet.yaml @@ -341,7 +341,7 @@ outputs: set_fact: rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" - name: set is_rpc_rabbitmq_bootstrap_node fact - set_fact: is_rpc_rabbitmq_bootstrap_node={{oslo_messaging_rpc_short_bootstrap_node_name|lower == ansible_hostname|lower}} + set_fact: is_rpc_rabbitmq_bootstrap_node={{oslo_messaging_rpc_short_bootstrap_node_name|lower == ansible_facts['hostname']|lower}} - name: Update rabbitmq-bundle pcs resource bundle for new container image when: - step|int == 1 diff --git a/deployment/swift/swift-storage-container-puppet.yaml b/deployment/swift/swift-storage-container-puppet.yaml index 449b385174..5fb5d1ba3c 100644 --- a/deployment/swift/swift-storage-container-puppet.yaml +++ b/deployment/swift/swift-storage-container-puppet.yaml @@ -639,11 +639,12 @@ outputs: gather_subset: - '!all' - 'hardware' + filter: 'ansible_device_links' when: swift_raw_disks - name: Mount devices defined in SwiftRawDisks mount: name: /srv/node/{{ item }} - src: "{% if lsblk.results['uuids'][item] is defined %}UUID={{ ansible_device_links['uuids'][item][0] }}{% else %}{{ swift_raw_disks[item]['base_dir']|default('/dev') }}/{{ item }}{% endif %}" + src: "{% if lsblk.results['uuids'][item] is defined %}UUID={{ ansible_facts['device_links']['uuids'][item][0] }}{% else %}{{ swift_raw_disks[item]['base_dir']|default('/dev') }}/{{ item }}{% endif %}" fstype: xfs opts: noatime state: mounted diff --git a/deployment/tls/undercloud-tls.yaml b/deployment/tls/undercloud-tls.yaml index 1796f07ef6..068fcf23e4 100644 --- a/deployment/tls/undercloud-tls.yaml +++ b/deployment/tls/undercloud-tls.yaml @@ -50,8 +50,8 @@ outputs: # openssl-perl is installed which provides /etc/pki/CA on RHEL8 - name: Ensure openssl-perl package is present on RHEL8 when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version == '8' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] is version('8', '==') package: name: openssl-perl state: present @@ -75,7 +75,7 @@ outputs: when: ipa_otp != '' - name: Set keytab permission facts set_fact: - nova_service: "nova/{{ ansible_nodename }}" + nova_service: "nova/{{ ansible_facts['nodename'] }}" nova_keytab: "/etc/novajoin/krb5.keytab" nova_keytab_group: "tripleo-admin" - name: Add directory for keytab diff --git a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml index 1294449f13..da6abec861 100644 --- a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml +++ b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml @@ -436,11 +436,11 @@ outputs: state: present loop: "{{ dnf_module_list|list }}" when: - - ansible_distribution_major_version >= '8' + - ansible_facts['distribution_major_version'] is version('8', '>=') - dnf_module_list|length > 0 - name: Ensure EL modules are in proper state shell: dnf -y distro-sync - when: ansible_distribution_major_version == '8' + when: ansible_facts['distribution_major_version'] == '8' retries: 5 delay: 10 register: _dnf_distro_sync @@ -449,7 +449,7 @@ outputs: package: name: python2-* state: absent - when: ansible_distribution_major_version == '8' + when: ansible_facts['distribution_major_version'] == '8' - name: Ensure TripleO prerequisite packages are installed package: name: @@ -462,7 +462,7 @@ outputs: - python3-heat-agent* - rsync state: present - when: ansible_distribution_major_version == '8' + when: ansible_facts['distribution_major_version'] is version('8', '==') - name: Special treatment for OpenvSwitch tripleo_ovs_upgrade: when: @@ -534,7 +534,7 @@ outputs: skip_rhel_enforcement: {get_param: SkipRhelEnforcement} when: - step|int == 0 - - ansible_distribution == 'RedHat' + - ansible_facts['distribution'] == 'RedHat' - not (skip_rhel_enforcement | bool) - name: Ensure DNF modules have the right stream vars: @@ -545,7 +545,7 @@ outputs: loop: "{{ dnf_module_list|list }}" when: - step|int == 0 - - ansible_distribution_major_version >= '8' + - ansible_facts['distribution_major_version'] is version('8', '>=') - dnf_module_list|length > 0 - name: Check for existing yum.pid stat: path=/var/run/yum.pid diff --git a/deployment/undercloud/undercloud-upgrade.yaml b/deployment/undercloud/undercloud-upgrade.yaml index a3eea1be50..ce95d39be4 100644 --- a/deployment/undercloud/undercloud-upgrade.yaml +++ b/deployment/undercloud/undercloud-upgrade.yaml @@ -65,7 +65,7 @@ outputs: skip_rhel_enforcement: {get_param: SkipRhelEnforcement} when: - step|int == 0 - - ansible_distribution == 'RedHat' + - ansible_facts['distribution'] == 'RedHat' - not (skip_rhel_enforcement | bool) - name: Ensure DNF modules have the right stream vars: @@ -76,7 +76,7 @@ outputs: loop: "{{ dnf_module_list|list }}" when: - step|int == 0 - - ansible_distribution_major_version >= '8' + - ansible_facts['distribution_major_version'] is version('8', '>=') - dnf_module_list|length > 0 - name: Special treatment for OpenvSwitch tripleo_ovs_upgrade: