From 01d242bcddfcd717cccb6205389b2b93a18f13aa Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 29 Nov 2022 16:57:11 +0100 Subject: [PATCH] Fix deprecated module ansible lint error Also reduce verbosity of ansible-lint as we don't really need so much DEBUG output, errors may get lost in there. Change-Id: I5f5a3ffd7f69275685695992732ed98549c6e5fa --- .ansible-lint | 2 +- .../roles/bifrost-configdrives-dynamic/tasks/main.yml | 2 +- playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml | 4 ++-- .../roles/bifrost-ironic-install/tasks/bootstrap.yml | 10 +++++----- .../bifrost-ironic-install/tasks/create_tftpboot.yml | 2 +- .../tasks/inspector_bootstrap.yml | 2 +- playbooks/roles/bifrost-ironic-install/tasks/main.yml | 10 +++++----- playbooks/roles/bifrost-ironic-install/tasks/start.yml | 4 ++-- .../roles/bifrost-keystone-install/tasks/main.yml | 8 ++++---- playbooks/roles/bifrost-nginx-install/tasks/main.yml | 6 +++--- playbooks/roles/bifrost-uwsgi-install/tasks/main.yml | 4 ++-- tools/ansible-lint.sh | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index e22f34a27..6de4c8d4f 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,6 +1,6 @@ skip_list: # FIXME: gradually fix and remove these exclusions: - - deprecated-module # Deprecated module + - fqcn[action] # Use FQCN for module actions - fqcn[action-core] # Use FQCN for builtin actions - jinja[spacing] # Jinja2 spacing could be improved - meta-no-info # meta/main.yml should contain relevant info diff --git a/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml b/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml index e317264c3..8413f6ec3 100644 --- a/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml +++ b/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml @@ -42,7 +42,7 @@ when: uuid is undefined - name: "Identify ssh_public_key from ssh_public_key_path" - include: ssh_public_key_path.yaml + include_tasks: ssh_public_key_path.yaml when: ssh_public_key is undefined - name: "Make temporary folder to build configdrive" diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml index cf3d75dc1..f4ea774a4 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml @@ -100,7 +100,7 @@ regexp: "^openstacksdk=" line: "openstacksdk===0.61.0" -- include: prepare_libvirt.yml +- import_tasks: prepare_libvirt.yml - name: truncate explicit list of vm names set_fact: @@ -122,7 +122,7 @@ testvm_json_data: {} testvm_nodes_json: [] -- include: create_vm.yml +- include_tasks: create_vm.yml loop: "{{ test_vm_node_names }}" - name: write to baremetal json file diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index 9629957e4..e138d9dee 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -208,11 +208,11 @@ when: vmedia_enable_tls | bool - name: "Populate keystone for Bifrost" - include: keystone_setup.yml + include_tasks: keystone_setup.yml when: enable_keystone | bool - name: "Read SSH key if needed" - import_tasks: ssh_public_key_path.yaml + include_tasks: ssh_public_key_path.yaml when: ipa_add_ssh_key | bool # NOTE(pas-ha) needed to e.g. pick up new interfaces after libvirt install @@ -221,7 +221,7 @@ gather_timeout: "{{ fact_gather_timeout }}" - name: "Generate ironic Configuration" - include: ironic_config.yml + import_tasks: ironic_config.yml - name: "Create the log directories (if requested)" file: @@ -263,7 +263,7 @@ mode: 0755 - name: "Install ironic-inspector to permit use of inspection interface" - include: inspector_bootstrap.yml + include_tasks: inspector_bootstrap.yml when: enable_inspector | bool - name: "Get ironic install location" @@ -387,7 +387,7 @@ - test_libvirt_dnsmasq.stat.exists - testing | bool - name: "Download Ironic Python Agent kernel & image" - include: download_ipa_image.yml + include_tasks: download_ipa_image.yml when: - not create_ipa_image | bool - download_ipa | bool diff --git a/playbooks/roles/bifrost-ironic-install/tasks/create_tftpboot.yml b/playbooks/roles/bifrost-ironic-install/tasks/create_tftpboot.yml index 7a0e6ef71..10c3037dc 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/create_tftpboot.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/create_tftpboot.yml @@ -78,7 +78,7 @@ and xinetd_tftp_disable is changed - name: "Download ipxe files if asked" - include: get_ipxe.yml + include_tasks: get_ipxe.yml when: download_ipxe | bool - name: "Copy iPXE image into place" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml index 730535e1d..40ce17a44 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml @@ -102,7 +102,7 @@ when: enable_tls | bool - name: "Populate keystone for ironic-inspector " - include: keystone_setup_inspector.yml + include_tasks: keystone_setup_inspector.yml when: enable_keystone | bool - name: "Inspector - Place Configuration" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/main.yml b/playbooks/roles/bifrost-ironic-install/tasks/main.yml index 75e8852c6..a65d98168 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/main.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/main.yml @@ -36,21 +36,21 @@ - "../defaults/dummy-defaults.yml" - name: "Install Ironic deps" - include: install.yml + include_tasks: install.yml when: not skip_package_install | bool - name: "Bootstrap Ironic" - include: bootstrap.yml + include_tasks: bootstrap.yml when: not skip_bootstrap | bool - name: "Start Ironic services" - include: start.yml + include_tasks: start.yml when: not skip_start | bool - name: "Perform online data migrations" - include: migrations.yml + include_tasks: migrations.yml when: not skip_migrations | bool - name: "Validate deployment" - include: validate.yml + include_tasks: validate.yml when: not skip_validation | bool diff --git a/playbooks/roles/bifrost-ironic-install/tasks/start.yml b/playbooks/roles/bifrost-ironic-install/tasks/start.yml index 90d29ef6e..7e49969f8 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/start.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/start.yml @@ -27,7 +27,7 @@ service: name={{ mysql_service_name }} state=started enabled=yes - name: "Start ironic-inspector" - include: inspector_start.yml + include_tasks: inspector_start.yml when: enable_inspector | bool - name: "Stop old ironic services" @@ -55,7 +55,7 @@ enabled: yes - name: "Start ironic-prometheus-exporter" - include: prometheus_exporter_start.yml + include_tasks: prometheus_exporter_start.yml when: enable_prometheus_exporter | bool and not skip_start | bool # Multiple dnsmasqs are likely running, so lets tell the service manager diff --git a/playbooks/roles/bifrost-keystone-install/tasks/main.yml b/playbooks/roles/bifrost-keystone-install/tasks/main.yml index 4f901dadf..d6194ec4b 100644 --- a/playbooks/roles/bifrost-keystone-install/tasks/main.yml +++ b/playbooks/roles/bifrost-keystone-install/tasks/main.yml @@ -34,26 +34,26 @@ - "../defaults/dummy-defaults.yml" - name: "Install Keystone" - include: install.yml + include_tasks: install.yml when: - enable_keystone | bool - not skip_package_install | bool - name: "Bootstrap Keystone" - include: bootstrap.yml + include_tasks: bootstrap.yml when: - enable_keystone | bool - not skip_bootstrap | bool - name: "Upgrade existing installation" - include: upgrade.yml + include_tasks: upgrade.yml when: - enable_keystone | bool - not skip_bootstrap | bool - not skip_start | bool - name: "Start Keystone services" - include: start.yml + include_tasks: start.yml when: - enable_keystone | bool - not skip_start | bool diff --git a/playbooks/roles/bifrost-nginx-install/tasks/main.yml b/playbooks/roles/bifrost-nginx-install/tasks/main.yml index b8f80096c..c4466a0c8 100644 --- a/playbooks/roles/bifrost-nginx-install/tasks/main.yml +++ b/playbooks/roles/bifrost-nginx-install/tasks/main.yml @@ -12,13 +12,13 @@ # limitations under the License. --- - name: "Install Nginx" - include: install.yml + include_tasks: install.yml when: not skip_package_install | bool - name: "Bootstrap Nginx" - include: bootstrap.yml + include_tasks: bootstrap.yml when: not skip_bootstrap | bool - name: "Start Nginx" - include: start.yml + include_tasks: start.yml when: not skip_start | bool diff --git a/playbooks/roles/bifrost-uwsgi-install/tasks/main.yml b/playbooks/roles/bifrost-uwsgi-install/tasks/main.yml index 66c5989d8..e170f3e24 100644 --- a/playbooks/roles/bifrost-uwsgi-install/tasks/main.yml +++ b/playbooks/roles/bifrost-uwsgi-install/tasks/main.yml @@ -12,9 +12,9 @@ # limitations under the License. --- - name: "Install uWSGI" - include: install.yml + include_tasks: install.yml when: not skip_package_install | bool - name: "Bootstrap uWSGI" - include: bootstrap.yml + include_tasks: bootstrap.yml when: not skip_bootstrap | bool diff --git a/tools/ansible-lint.sh b/tools/ansible-lint.sh index bd97ab34a..681231abf 100644 --- a/tools/ansible-lint.sh +++ b/tools/ansible-lint.sh @@ -20,6 +20,6 @@ export ANSIBLE_COLLECTIONS_PATHS="$(realpath $DEST)" export ANSIBLE_LIBRARY="$(dirname $0)/../playbooks/library" find playbooks -maxdepth 1 -type f -regex '.*.ya?ml' -print0 | \ - xargs -t -n1 -0 ansible-lint -vv --nocolor + xargs -t -n1 -0 ansible-lint -v --nocolor find playbooks/roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \ - xargs -t -n1 ansible-lint -vv --nocolor + xargs -t -n1 ansible-lint -v --nocolor