diff --git a/.ansible-lint b/.ansible-lint index 416dda831..ab5fff5e3 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,6 +1,7 @@ exclude_paths: - releasenotes/ - playbooks/ceph-pg.yaml + - ci/playbooks/ parseable: true quiet: false rulesdir: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index feecbcd77..285f2437e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,10 @@ repos: always_run: true pass_filenames: false additional_dependencies: - - 'ansible<2.10' + - 'ansible-core<2.12' + verbose: true + entry: ansible-lint --force-color -p -v + - repo: https://github.com/openstack-dev/bashate.git rev: 2.0.0 hooks: diff --git a/ansible-collections-requirements.yml b/ansible-collections-requirements.yml new file mode 100644 index 000000000..e4971c9d8 --- /dev/null +++ b/ansible-collections-requirements.yml @@ -0,0 +1,5 @@ +--- +collections: + - containers.podman + - community.general + - ansible.posix diff --git a/ci/playbooks/pre.yml b/ci/playbooks/pre.yml index 30ed9f1fb..82300333d 100644 --- a/ci/playbooks/pre.yml +++ b/ci/playbooks/pre.yml @@ -45,6 +45,9 @@ virtualenv_command: "{{ ensure_pip_virtualenv_command }}" virtualenv_site_packages: true + - name: Set up collections + command: "{{ ansible_user_dir }}/test-python/bin/ansible-galaxy install -fr {{ tripleo_validations_project_path }}/ansible-collections-requirements.yml" + - name: Display test-python virtualenv package versions shell: |- . {{ ansible_user_dir }}/test-python/bin/activate diff --git a/molecule-requirements.txt b/molecule-requirements.txt index 8b7c04341..2b13e8e09 100644 --- a/molecule-requirements.txt +++ b/molecule-requirements.txt @@ -1,6 +1,6 @@ # this is required for the molecule jobs ansi2html>=1.6.0 # LGPLv3+ -ansible>=2.8,!=2.8.9,!=2.9.12,<2.10.0 # GPLv3+ +ansible-core<2.12 # GPLv3+ jinja2>=2.8.0 # BSD-3-Clause molecule>=3.3.1,<4 # MIT molecule-podman>=0.3.0 # MIT diff --git a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml index 21e486307..469facdaf 100644 --- a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml +++ b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/check_nfv_instances.yml @@ -11,7 +11,7 @@ instance_xml_data: "{{ instance_xml.stdout }}" - name: Get interfaces from xml string - xml: + community.general.xml: xmlstring: "{{ instance_xml_data }}" xpath: /domain/devices/interface content: attribute diff --git a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml index 8218882db..ec7ec4cab 100644 --- a/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml +++ b/roles/check_nfv_ovsdpdk_zero_packet_loss/tasks/validate_instance.yml @@ -1,6 +1,6 @@ --- - name: Get instance numa node from xml string - xml: + community.general.xml: xmlstring: "{{ instance_xml_data }}" xpath: /domain/numatune/memory content: attribute @@ -13,7 +13,7 @@ # Validates the instance vcpus list. - name: Get vcpu list from xml string - xml: + community.general.xml: xmlstring: "{{ instance_xml_data }}" xpath: /domain/cputune/vcpupin content: attribute @@ -44,7 +44,7 @@ # Validates instance emulatorpin threads - name: Get emulatorpin list from xml string - xml: + community.general.xml: xmlstring: "{{ instance_xml_data }}" xpath: /domain/cputune/emulatorpin content: attribute @@ -62,7 +62,7 @@ # Validates instance huge page size length is greater than or equal to 6. - name: Get hugepages from xml string - xml: + community.general.xml: xmlstring: "{{ instance_xml_data }}" xpath: /domain/memoryBacking/hugepages/page content: attribute @@ -77,7 +77,7 @@ # Validates instance tx rx queue sizes and should be greater than or equal to 1024. - name: Get {{ vm_id }} libvirt tx | rx queue sizes from xml string - xml: + community.general.xml: xmlstring: "{{ instance_xml_data }}" xpath: /domain/devices/interface/driver content: attribute diff --git a/roles/nova_svirt/tasks/validate.yml b/roles/nova_svirt/tasks/validate.yml index ee4a42f34..0035af0a3 100644 --- a/roles/nova_svirt/tasks/validate.yml +++ b/roles/nova_svirt/tasks/validate.yml @@ -2,7 +2,7 @@ - name: "Parse {{ item.path }}" become: true register: seclabels - xml: + community.general.xml: path: "{{ item.path }}" content: attribute xpath: '/domstatus/domain/seclabel' diff --git a/tox.ini b/tox.ini index e504f160e..d13fc0e50 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,7 @@ setenv = LC_ALL=en_US.UTF-8 HOME={envdir} commands = + ansible-galaxy install -fr {toxinidir}/ansible-collections-requirements.yml stestr run --slowest --color {posargs} deps = -c {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}