diff --git a/test-distro_install-vars.yml b/test-distro_install-vars.yml index 94c13558..aeabe371 100644 --- a/test-distro_install-vars.yml +++ b/test-distro_install-vars.yml @@ -18,7 +18,7 @@ # all their testing using the source-based installation of # tempest. As such, for all ubuntu distribution tests we # force the use of the source install for tempest. -tempest_install_method: "{{ (ansible_distribution | lower == 'ubuntu') | ternary('source', 'distro') }}" +tempest_install_method: "{{ (ansible_facts['distribution'] | lower == 'ubuntu') | ternary('source', 'distro') }}" # # Use $role_install_method=distro so we can test the combined diff --git a/test-install-neutron.yml b/test-install-neutron.yml index 05bc2256..995f10b8 100644 --- a/test-install-neutron.yml +++ b/test-install-neutron.yml @@ -35,11 +35,11 @@ lxc_container: name: "{{ container_name }}" container_command: | - [[ ! -d "/{{ kernel_module_path[ansible_pkg_mgr] }}" ]] && mkdir -p "/{{ kernel_module_path[ansible_pkg_mgr] }}" + [[ ! -d "/{{ kernel_module_path[ansible_facts['pkg_mgr']] }}" ]] && mkdir -p "/{{ kernel_module_path[ansible_facts['pkg_mgr']] }}" container_config: - "lxc.apparmor.profile=unconfined" - "lxc.cgroup.devices.allow=a *:* rmw" - - "lxc.mount.entry=/{{ kernel_module_path[ansible_pkg_mgr] }} {{ kernel_module_path[ansible_pkg_mgr] }} none bind 0 0" + - "lxc.mount.entry=/{{ kernel_module_path[ansible_facts['pkg_mgr']] }} {{ kernel_module_path[ansible_facts['pkg_mgr']] }} none bind 0 0" delegate_to: "{{ physical_host }}" - name: Wait for container connectivity @@ -70,7 +70,7 @@ # neutron wheel - name: Install packages required to build neutron python package package: - name: "{{ required_packages[ansible_pkg_mgr] }}" + name: "{{ required_packages[ansible_facts['pkg_mgr']] }}" state: present register: install_packages until: install_packages is success diff --git a/test-install-nova.yml b/test-install-nova.yml index 7b335ed6..aab732bf 100644 --- a/test-install-nova.yml +++ b/test-install-nova.yml @@ -41,7 +41,7 @@ # nova wheel - name: Install packages required to build nova python package package: - name: "{{ required_packages[ansible_pkg_mgr] }}" + name: "{{ required_packages[ansible_facts['pkg_mgr']] }}" state: present diff --git a/test-prepare-host.yml b/test-prepare-host.yml index 28f74abb..47dfdeb2 100644 --- a/test-prepare-host.yml +++ b/test-prepare-host.yml @@ -60,7 +60,7 @@ # be fixed (instead of timeouts). - name: Use present for package_state on CentOS set_fact: - package_state: "{{ (ansible_pkg_mgr == 'dnf') | ternary('present', 'latest') }}" + package_state: "{{ (ansible_facts['pkg_mgr'] == 'dnf') | ternary('present', 'latest') }}" - name: Setup clouds.yaml for the test user include_role: @@ -193,15 +193,15 @@ ' gso off sg off tso off tx off'] %} {% for interface in (bridges | default([])) %} {% if interface is string %} - {% set _ = veths.append('-' + iptool_path[ansible_os_family | lower] + ' link set ' + interface + ' up') %} + {% set _ = veths.append('-' + iptool_path[ansible_facts['os_family'] | lower] + ' link set ' + interface + ' up') %} {% set _ = veths.append('-/sbin/ethtool -K ' + interface + ' gso off sg off tso off tx off') %} {% else %} {% set interface_name = (interface.name | default('br-mgmt')) %} - {% set _ = veths.append('-' + iptool_path[ansible_os_family | lower] + ' link set ' + interface_name + ' up') %} + {% set _ = veths.append('-' + iptool_path[ansible_facts['os_family'] | lower] + ' link set ' + interface_name + ' up') %} {% set _ = veths.append('-/sbin/ethtool -K ' + interface_name + ' gso off sg off tso off tx off') %} {% if interface.veth_peer is defined %} - {% set _ = veths.append('-' + iptool_path[ansible_os_family | lower] + ' link set ' + interface_name + '-veth up') %} - {% set _ = veths.append('-' + iptool_path[ansible_os_family | lower] + ' link set ' + interface.veth_peer + ' up') %} + {% set _ = veths.append('-' + iptool_path[ansible_facts['os_family'] | lower] + ' link set ' + interface_name + '-veth up') %} + {% set _ = veths.append('-' + iptool_path[ansible_facts['os_family'] | lower] + ' link set ' + interface.veth_peer + ' up') %} {% set _ = veths.append('-/sbin/ethtool -K ' + interface.veth_peer + ' gso off sg off tso off tx off') %} {% endif %} {% endif %} diff --git a/test-setup-swifthosts.yml b/test-setup-swifthosts.yml index d2e537f5..fcbf6d18 100644 --- a/test-setup-swifthosts.yml +++ b/test-setup-swifthosts.yml @@ -32,13 +32,13 @@ package: name: xfsprogs state: present - # NOTE(hwoarang) Use the ansible_pkg_mgr fact gathered by + # NOTE(hwoarang) Use the ansible_facts['pkg_mgr'] fact gathered by # the setup module for the container because package manager # detection does not work as expected when the task is delegated. - # The reason is that the package module expects hostvars['%s']['ansible_pkg_mgr'] + # The reason is that the package module expects hostvars['%s']['ansible_facts']['pkg_mgr'] # to be populated on delegated tasks but this is not the case here # because we haven't run the setup module on localhost. - use: "{{ ansible_pkg_mgr }}" + use: "{{ ansible_facts['pkg_mgr'] }}" delegate_to: "{{ physical_host }}" run_once: true diff --git a/test-vars.yml b/test-vars.yml index 769f334e..3f9a4548 100644 --- a/test-vars.yml +++ b/test-vars.yml @@ -69,7 +69,7 @@ lxc_net_bridge: lxcbr0 lxc_kernel_options: - { key: 'fs.inotify.max_user_instances', value: 1024 } lxc_container_config_list: - - "lxc.apparmor.profile={{ (hostvars[physical_host]['ansible_distribution'] == 'Debian') | ternary('unconfined', 'lxc-openstack') }}" + - "lxc.apparmor.profile={{ (hostvars[physical_host]['ansible_facts']['distribution'] == 'Debian') | ternary('unconfined', 'lxc-openstack') }}" is_metal: "{{ not (ansible_facts['virtualization_type'] in ['lxc', 'systemd-nspawn']) }}" diff --git a/zuul.d/playbooks/pre-gate-cleanup.yml b/zuul.d/playbooks/pre-gate-cleanup.yml index 09867106..8462c211 100644 --- a/zuul.d/playbooks/pre-gate-cleanup.yml +++ b/zuul.d/playbooks/pre-gate-cleanup.yml @@ -24,7 +24,7 @@ regexp: 'https' replace: "http" when: - - ansible_distribution_release in ['bionic', 'focal'] + - ansible_facts['distribution_release'] in ['bionic', 'focal'] - name: Remove package blacklist for dnf lineinfile: