Use ansible_facts instead

In order to ANSIBLE_INJECT_FACT_VARS=False we have to use ansible_facts
instead of ansible_* vars. This change switches our distribution and
hostname related items to use ansible_facts instead.

Change-Id: I49a2c42dcbb74671834f312798367f411c819813
Related-Bug: #1915761
(cherry picked from commit 8d1fc85744)
This commit is contained in:
Alex Schultz 2021-02-19 08:29:01 -07:00
parent cc9a390b57
commit 603beaa023
24 changed files with 58 additions and 57 deletions

View File

@ -164,7 +164,7 @@
# Bootstrap tasks - run any tasks that have been defined # 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 become: true
file: file:
path: /var/lib/container-puppet/container-puppet-tasks{{step}}.json path: /var/lib/container-puppet/container-puppet-tasks{{step}}.json
@ -172,11 +172,11 @@
tags: tags:
- container_config_tasks - 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: set_fact:
"{{'host_container_puppet_tasks_' ~ step}}": "{{lookup('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | union([item])}}" "{{'host_container_puppet_tasks_' ~ step}}": "{{lookup('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | union([item])}}"
loop: "{{container_puppet_tasks.get('step_' ~ step, [])}}" 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: vars:
container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}" container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
tags: tags:

View File

@ -1105,9 +1105,9 @@ outputs:
loop_control: loop_control:
loop_var: step loop_var: step
tags: always 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. # 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 # 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 operator to scale down the cloud no matter the state of
# the servers. # the servers.
@ -1118,9 +1118,9 @@ outputs:
msg: "Node is unreachable. No scale tasks will be run." msg: "Node is unreachable. No scale tasks will be run."
ignore_errors: True ignore_errors: True
tags: always 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. # or not.
when: ansible_hostname is not defined when: ansible_facts['hostname'] is not defined
tags: tags:
- scale - scale
post_update_steps_tasks: | post_update_steps_tasks: |

View File

@ -1,13 +1,13 @@
- name: Gather facts needed by role if necessary - name: Gather facts needed by role if necessary
setup: setup:
gather_subset: "!min,python" gather_subset: "!min,python"
when: ansible_python is not defined when: ansible_facts['python'] is not defined
tags: tags:
- container_config_tasks - container_config_tasks
- name: set python_cmd if necessary - name: set python_cmd if necessary
set_fact: set_fact:
python_cmd: "python{{ ansible_python.version.major }}" python_cmd: "python{{ ansible_facts['python']['version']['major'] }}"
cacheable: true cacheable: true
when: python_cmd is not defined when: python_cmd is not defined
tags: tags:
@ -35,7 +35,7 @@
MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet | default(true)}}' MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet | default(true)}}'
CONTAINER_LOG_STDOUT_PATH: "{{ container_log_stdout_path }}" CONTAINER_LOG_STDOUT_PATH: "{{ container_log_stdout_path }}"
CONTAINER_HEALTHCHECK_DISABLED: "{{ container_healthcheck_disabled }}" CONTAINER_HEALTHCHECK_DISABLED: "{{ container_healthcheck_disabled }}"
SHORT_HOSTNAME: "{{ ansible_hostname | lower }}" SHORT_HOSTNAME: "{{ ansible_facts['hostname'] | lower }}"
check_mode: no check_mode: no
register: generate_config_async_result register: generate_config_async_result
@ -77,7 +77,7 @@
net_host: true net_host: true
no_archive: false no_archive: false
puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet.json" 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 }}" step: "{{ step }}"
- name: "Manage Puppet containers (generate config) for step {{ step }} with tripleo-ansible" - name: "Manage Puppet containers (generate config) for step {{ step }} with tripleo-ansible"

View File

@ -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 no_log: True
copy: copy:
content: "{{lookup ('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | to_nice_json}}" content: "{{lookup ('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | to_nice_json}}"
@ -12,13 +12,13 @@
- name: Gather ansible facts if necessary - name: Gather ansible facts if necessary
setup: setup:
gather_subset: "!min,python" gather_subset: "!min,python"
when: ansible_python is not defined when: ansible_facts['python'] is not defined
tags: tags:
- container_config_tasks - container_config_tasks
- name: Set python_cmd if necessary - name: Set python_cmd if necessary
set_fact: set_fact:
python_cmd: "python{{ ansible_python.version.major }}" python_cmd: "python{{ ansible_facts['python']['version']['major'] }}"
cacheable: true cacheable: true
when: python_cmd is not defined when: python_cmd is not defined
tags: tags:
@ -43,7 +43,7 @@
CONTAINER_CLI: "{{ container_cli }}" CONTAINER_CLI: "{{ container_cli }}"
DEBUG: "{{ docker_puppet_debug }}" DEBUG: "{{ docker_puppet_debug }}"
MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet}}' 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 }}" PROCESS_COUNT: "{{ docker_puppet_process_count }}"
register: bootstrap_tasks_async_result register: bootstrap_tasks_async_result
no_log: true no_log: true
@ -77,7 +77,7 @@
net_host: true net_host: true
no_archive: true no_archive: true
puppet_config: "/var/lib/container-puppet/{{ ansible_check_mode | bool | ternary('check-mode/', '') }}container-puppet-tasks{{ step }}.json" 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 }}" step: "{{ step }}"
- name: "Manage Puppet containers (bootstrap tasks) for step {{ step }} with tripleo-ansible" - name: "Manage Puppet containers (bootstrap tasks) for step {{ step }} with tripleo-ansible"

View File

@ -305,7 +305,7 @@ outputs:
cinder_backup_pcs_res: "{{cinder_backup_pcs_res_result.rc == 0}}" cinder_backup_pcs_res: "{{cinder_backup_pcs_res_result.rc == 0}}"
- name: set is_cinder_backup_bootstrap_node fact - name: set is_cinder_backup_bootstrap_node fact
tags: common 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 - name: Update cinder_backup pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -286,7 +286,7 @@ outputs:
cinder_volume_pcs_res: "{{cinder_volume_pcs_res_result.rc == 0}}" cinder_volume_pcs_res: "{{cinder_volume_pcs_res_result.rc == 0}}"
- name: set is_cinder_volume_bootstrap_node fact - name: set is_cinder_volume_bootstrap_node fact
tags: common 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 - name: Update cinder_volume pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -473,7 +473,7 @@ outputs:
galera_pcs_res: "{{galera_pcs_res_result.rc == 0}}" galera_pcs_res: "{{galera_pcs_res_result.rc == 0}}"
- name: set is_mysql_bootstrap_node fact - name: set is_mysql_bootstrap_node fact
tags: common 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 - name: Update galera pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -384,7 +384,7 @@ outputs:
- name: Set upgrade redis facts - name: Set upgrade redis facts
set_fact: set_fact:
redis_pcs_res: "{{redis_pcs_res_result.rc == 0}}" 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 - name: Update redis-bundle pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -338,7 +338,7 @@ outputs:
block: &haproxy_update_upgrade_facts block: &haproxy_update_upgrade_facts
- name: set is_haproxy_bootstrap_node fact - name: set is_haproxy_bootstrap_node fact
tags: common 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: when:
- haproxy_short_bootstrap_node_name|default(false) - haproxy_short_bootstrap_node_name|default(false)
- name: Mount TLS cert if needed - name: Mount TLS cert if needed
@ -453,7 +453,7 @@ outputs:
- name: Set upgrade haproxy facts - name: Set upgrade haproxy facts
set_fact: set_fact:
haproxy_pcs_res: "{{haproxy_pcs_res_result.rc == 0}}" 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 - name: Update haproxy pcs resource bundle for new container image
when: when:

View File

@ -85,7 +85,7 @@ outputs:
path: "{{cert_path}}" path: "{{cert_path}}"
- name: set is_haproxy_bootstrap_node fact - 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: when:
- haproxy_short_bootstrap_node_name|default(false) - haproxy_short_bootstrap_node_name|default(false)

View File

@ -116,9 +116,9 @@ outputs:
if: if:
- idm_server_provided - idm_server_provided
- IPA_HOST: {get_param: IdMServer} - IPA_HOST: {get_param: IdMServer}
IPA_USER: "nova/{{ ansible_fqdn }}" IPA_USER: "nova/{{ ansible_facts['fqdn'] }}"
KRB5_CLIENT_KTNAME: {get_param: IdMNovaKeytab} KRB5_CLIENT_KTNAME: {get_param: IdMNovaKeytab}
- IPA_USER: "nova/{{ ansible_fqdn }}" - IPA_USER: "nova/{{ ansible_facts['fqdn'] }}"
KRB5_CLIENT_KTNAME: {get_param: IdMNovaKeytab} KRB5_CLIENT_KTNAME: {get_param: IdMNovaKeytab}
deploy_steps_tasks: deploy_steps_tasks:
- name: enroll the node as an ipa client - name: enroll the node as an ipa client

View File

@ -262,7 +262,7 @@ outputs:
manila_share_pcs_res: "{{manila_share_pcs_res_result.rc == 0}}" manila_share_pcs_res: "{{manila_share_pcs_res_result.rc == 0}}"
- name: set is_manila_share_bootstrap_node fact - name: set is_manila_share_bootstrap_node fact
tags: common 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 - name: Update openstack-manila-share pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -1207,7 +1207,7 @@ outputs:
register: iha_nodes register: iha_nodes
- name: If instance HA is enabled on the node activate the evacuation completed check - name: If instance HA is enabled on the node activate the evacuation completed check
file: path=/var/lib/nova/instanceha/enabled state=touch 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 - name: Is irqbalance enabled
set_fact: set_fact:
compute_irqbalance_disabled: {get_attr: [RoleParametersValue, value, compute_disable_irqbalance]} compute_irqbalance_disabled: {get_attr: [RoleParametersValue, value, compute_disable_irqbalance]}
@ -1289,21 +1289,21 @@ outputs:
name: qemu-kvm-common-ev name: qemu-kvm-common-ev
state: present state: present
when: when:
- ansible_distribution == 'CentOS' - ansible_facts['distribution'] == 'CentOS'
- ansible_distribution_major_version == '7' - ansible_facts['distribution_major_version'] is version('7', '==')
- name: make sure package providing ksmtuned is installed (RHEL7) - name: make sure package providing ksmtuned is installed (RHEL7)
package: package:
name: qemu-kvm-common-rhev name: qemu-kvm-common-rhev
state: present state: present
when: when:
- ansible_distribution == 'RedHat' - ansible_facts['distribution'] == 'RedHat'
- ansible_distribution_major_version == '7' - ansible_facts['distribution_major_version'] is version('7', '==')
- name: make sure package providing ksmtuned is installed (RHEL8 or CentOS8) - name: make sure package providing ksmtuned is installed (RHEL8 or CentOS8)
package: package:
name: qemu-kvm-common name: qemu-kvm-common
state: present state: present
when: when:
- ansible_distribution_major_version == '8' - ansible_facts['distribution_major_version'] is version('8', '==')
- name: enable ksmtunded - name: enable ksmtunded
service: service:
name: "{{ item }}" name: "{{ item }}"
@ -1359,13 +1359,13 @@ outputs:
is_additional_cell: {get_param: NovaAdditionalCell} is_additional_cell: {get_param: NovaAdditionalCell}
- name: Set fact for nova_compute services - name: Set fact for nova_compute services
set_fact: 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 delegate_to: localhost
check_mode: no check_mode: no
- name: Check search output - name: Check search output
fail: fail:
msg: >- 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 This means that the FQDN of the selected device to disable is
either wrong or is sharing a name with another host, which is either wrong or is sharing a name with another host, which is
also wrong. Please correct this issue before continuing. Nova also wrong. Please correct this issue before continuing. Nova

View File

@ -237,8 +237,8 @@ outputs:
# openssl-perl is installed which provides /etc/pki/CA on RHEL8 # openssl-perl is installed which provides /etc/pki/CA on RHEL8
- name: Ensure openssl-perl package is present on RHEL8 - name: Ensure openssl-perl package is present on RHEL8
when: when:
- ansible_os_family == 'RedHat' - ansible_facts['os_family'] == 'RedHat'
- ansible_distribution_major_version == '8' - ansible_facts['distribution_major_version'] is version('8', '==')
package: package:
name: openssl-perl name: openssl-perl
state: present state: present
@ -264,6 +264,6 @@ outputs:
creates: /etc/ipa/default.conf creates: /etc/ipa/default.conf
when: ipa_otp != '' when: ipa_otp != ''
- name: Request kerberos keytab - 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: args:
creates: /etc/novajoin/krb5.keytab creates: /etc/novajoin/krb5.keytab

View File

@ -303,7 +303,7 @@ outputs:
{%- if 'octavia_' ~ octavia_groups %} {%- if 'octavia_' ~ octavia_groups %}
{% for host in groups['octavia_' ~ octavia_group] -%} {% 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_user: {{ hostvars.raw_get(host)['ansible_ssh_user'] | default('heat-admin') }}
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) | lower }} ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) | lower }}
canonical_hostname: {{ hostvars.raw_get(host)['canonical_hostname'] | default(host) | lower }} canonical_hostname: {{ hostvars.raw_get(host)['canonical_hostname'] | default(host) | lower }}
@ -316,7 +316,7 @@ outputs:
Undercloud: Undercloud:
hosts: hosts:
{% for host in groups['Undercloud'] -%} {% 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_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) | lower }}
ansible_become: false ansible_become: false
ansible_connection: local ansible_connection: local

View File

@ -151,7 +151,7 @@ outputs:
- python2-openstackclient - python2-openstackclient
- openssl - openssl
state: present 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 - name: Ensure packages required for configuring octavia are present for CentOS/RHEL 8
package: package:
@ -160,7 +160,7 @@ outputs:
- python3-openstackclient - python3-openstackclient
- openssl - openssl
state: present state: present
when: ansible_distribution_major_version is version(8, '>=') when: ansible_facts['distribution_major_version'] is version(8, '>=')
when: {get_param: EnablePackageInstall} when: {get_param: EnablePackageInstall}
- name: enable virt_sandbox_use_netlink for healthcheck - name: enable virt_sandbox_use_netlink for healthcheck
seboolean: seboolean:

View File

@ -372,7 +372,7 @@ outputs:
- name: Update ovn-dbs-bundle resource to use pcmklatest tag image if not used - name: Update ovn-dbs-bundle resource to use pcmklatest tag image if not used
when: when:
- step|int == 5 - 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: block:
- name: Get the present image used by ovn-dbs-bundle - name: Get the present image used by ovn-dbs-bundle
shell: "pcs resource config ovn-dbs-bundle | grep -Eo 'image=[^ ]+' | awk -F= '{print $2;}'" shell: "pcs resource config ovn-dbs-bundle | grep -Eo 'image=[^ ]+' | awk -F= '{print $2;}'"
@ -436,7 +436,7 @@ outputs:
- name: Update ovn_dbs pcs resource bundle for new container image - name: Update ovn_dbs pcs resource bundle for new container image
when: when:
- step|int == 1 - 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_pcs_res|bool
- ovn_dbs_image_current != ovn_dbs_image_latest - ovn_dbs_image_current != ovn_dbs_image_latest
block: block:
@ -518,7 +518,7 @@ outputs:
- name: Restart ovn-dbs service (pacemaker) - name: Restart ovn-dbs service (pacemaker)
when: when:
- step|int == 1 - 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: pacemaker_resource:
resource: ovn-dbs-bundle resource: ovn-dbs-bundle
state: restart state: restart

View File

@ -346,7 +346,7 @@ outputs:
set_fact: set_fact:
rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}"
- name: set is_notify_rabbitmq_bootstrap_node fact - 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 - name: Update rabbitmq-bundle pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -347,7 +347,7 @@ outputs:
rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}"
- name: set is_rabbitmq_bootstrap_node fact - name: set is_rabbitmq_bootstrap_node fact
tags: common 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 - name: Update rabbitmq-bundle pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -352,7 +352,7 @@ outputs:
set_fact: set_fact:
rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}" rabbitmq_pcs_res: "{{rabbitmq_pcs_res_result.rc == 0}}"
- name: set is_rpc_rabbitmq_bootstrap_node fact - 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 - name: Update rabbitmq-bundle pcs resource bundle for new container image
when: when:
- step|int == 1 - step|int == 1

View File

@ -627,11 +627,12 @@ outputs:
gather_subset: gather_subset:
- '!all' - '!all'
- 'hardware' - 'hardware'
filter: 'ansible_device_links'
when: swift_raw_disks when: swift_raw_disks
- name: Mount devices defined in SwiftRawDisks - name: Mount devices defined in SwiftRawDisks
mount: mount:
name: /srv/node/{{ item }} 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 fstype: xfs
opts: noatime opts: noatime
state: mounted state: mounted

View File

@ -50,8 +50,8 @@ outputs:
# openssl-perl is installed which provides /etc/pki/CA on RHEL8 # openssl-perl is installed which provides /etc/pki/CA on RHEL8
- name: Ensure openssl-perl package is present on RHEL8 - name: Ensure openssl-perl package is present on RHEL8
when: when:
- ansible_os_family == 'RedHat' - ansible_facts['os_family'] == 'RedHat'
- ansible_distribution_major_version == '8' - ansible_facts['distribution_major_version'] is version('8', '==')
package: package:
name: openssl-perl name: openssl-perl
state: present state: present
@ -75,7 +75,7 @@ outputs:
when: ipa_otp != '' when: ipa_otp != ''
- name: Set keytab permission facts - name: Set keytab permission facts
set_fact: set_fact:
nova_service: "nova/{{ ansible_nodename }}" nova_service: "nova/{{ ansible_facts['nodename'] }}"
nova_keytab: "/etc/novajoin/krb5.keytab" nova_keytab: "/etc/novajoin/krb5.keytab"
nova_keytab_group: "tripleo-admin" nova_keytab_group: "tripleo-admin"
- name: Add directory for keytab - name: Add directory for keytab

View File

@ -258,7 +258,7 @@ outputs:
state: present state: present
loop: "{{ dnf_module_list|list }}" loop: "{{ dnf_module_list|list }}"
when: when:
- ansible_distribution_major_version >= '8' - ansible_facts['distribution_major_version'] is version('8', '>=')
- dnf_module_list|length > 0 - dnf_module_list|length > 0
- name: Ensure TripleO prerequisite packages are installed - name: Ensure TripleO prerequisite packages are installed
package: package:
@ -272,7 +272,7 @@ outputs:
- python3-heat-agent* - python3-heat-agent*
- rsync - rsync
state: present state: present
when: ansible_distribution_major_version == '8' when: ansible_facts['distribution_major_version'] is version('8', '==')
- name: Special treatment for OpenvSwitch - name: Special treatment for OpenvSwitch
tripleo_ovs_upgrade: tripleo_ovs_upgrade:
when: when:
@ -347,7 +347,7 @@ outputs:
skip_rhel_enforcement: {get_param: SkipRhelEnforcement} skip_rhel_enforcement: {get_param: SkipRhelEnforcement}
when: when:
- step|int == 0 - step|int == 0
- ansible_distribution == 'RedHat' - ansible_facts['distribution'] == 'RedHat'
- not (skip_rhel_enforcement | bool) - not (skip_rhel_enforcement | bool)
- name: Ensure DNF modules have the right stream - name: Ensure DNF modules have the right stream
vars: vars:
@ -358,7 +358,7 @@ outputs:
loop: "{{ dnf_module_list|list }}" loop: "{{ dnf_module_list|list }}"
when: when:
- step|int == 0 - step|int == 0
- ansible_distribution_major_version >= '8' - ansible_facts['distribution_major_version'] is version('8', '>=')
- dnf_module_list|length > 0 - dnf_module_list|length > 0
- name: Check for existing yum.pid - name: Check for existing yum.pid
stat: path=/var/run/yum.pid stat: path=/var/run/yum.pid

View File

@ -65,7 +65,7 @@ outputs:
skip_rhel_enforcement: {get_param: SkipRhelEnforcement} skip_rhel_enforcement: {get_param: SkipRhelEnforcement}
when: when:
- step|int == 0 - step|int == 0
- ansible_distribution == 'RedHat' - ansible_facts['distribution'] == 'RedHat'
- not (skip_rhel_enforcement | bool) - not (skip_rhel_enforcement | bool)
- name: Ensure DNF modules have the right stream - name: Ensure DNF modules have the right stream
vars: vars:
@ -76,7 +76,7 @@ outputs:
loop: "{{ dnf_module_list|list }}" loop: "{{ dnf_module_list|list }}"
when: when:
- step|int == 0 - step|int == 0
- ansible_distribution_major_version >= '8' - ansible_facts['distribution_major_version'] is version('8', '>=')
- dnf_module_list|length > 0 - dnf_module_list|length > 0
- name: Special treatment for OpenvSwitch - name: Special treatment for OpenvSwitch
tripleo_ovs_upgrade: tripleo_ovs_upgrade: