diff --git a/.ansible-lint b/.ansible-lint index e420c215..72c7790f 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -4,3 +4,19 @@ skip_list: - '306' - '602' - '701' + +warn_list: # or 'skip_list' to silence them completely + - experimental # all rules tagged as experimental + - unnamed-task # All tasks should be named + - var-spacing # Variables should have spaces before and after: {{ var_name }} + +exclude_paths: +- ansible/files +- ansible/roles/prepare_rhos_release +- ansible/datavolume_tasks.yaml +- ansible/extrafeature_heat_env.yaml +- ansible/extrafeature_tarball_config.yaml +- ansible/local_storage_tasks.yaml +- ansible/ocs.yaml +- ansible/pull-secret.yaml +- ansible/virt_sriov_vm.yaml diff --git a/.github/workflows/ansible-lint.yaml b/.github/workflows/ansible-lint.yaml index ecca672a..ec400c23 100644 --- a/.github/workflows/ansible-lint.yaml +++ b/.github/workflows/ansible-lint.yaml @@ -15,8 +15,7 @@ jobs: with: targets: | **/*.yaml - args: "--exclude ansible/roles/prepare_rhos_release" override-deps: | ansible==2.10.7 ansible-base==2.10.5 - ansible-lint==4.3.7 + ansible-lint==5.3.2 diff --git a/ansible/datavolume.yaml b/ansible/datavolume.yaml index 3fa68905..1c53ff13 100644 --- a/ansible/datavolume.yaml +++ b/ansible/datavolume.yaml @@ -54,6 +54,8 @@ - name: create datavolume for vmset roles include_tasks: datavolume_tasks.yaml + vars: + _datavolume: "{{ _role | lower }}-base-img" loop: "{{ osp.vmset.keys() | list }}" loop_control: loop_var: _role diff --git a/ansible/datavolume_tasks.yaml b/ansible/datavolume_tasks.yaml index 2ea7462d..01c3b921 100644 --- a/ansible/datavolume_tasks.yaml +++ b/ansible/datavolume_tasks.yaml @@ -1,8 +1,4 @@ --- -- name: Set datavolume image fact - set_fact: - _datavolume: "{{ _role | lower }}-base-img" - # Make sure we delete the datavolume e.g. when switch from rhel image to centos image # This won't solve the problem when the both images exist and we switch back. - name: delete {{ _datavolume }} datavolume if image got downloaded diff --git a/ansible/extrafeature_heat_env.yaml b/ansible/extrafeature_heat_env.yaml index 28c78a28..3f6273d8 100644 --- a/ansible/extrafeature_heat_env.yaml +++ b/ansible/extrafeature_heat_env.yaml @@ -1,9 +1,6 @@ -- name: Set feature template dir - set_fact: - feature_dir: "{{ playbook_dir }}/templates/osp/tripleo_heat_envs/features/{{ osp.release }}/{{ feature }}" - +--- - name: Get stats of the local feature dir - stat: + ansible.builtin.stat: path="{{ feature_dir }}" delegate_to: localhost register: p diff --git a/ansible/extrafeature_tarball_config.yaml b/ansible/extrafeature_tarball_config.yaml index 41bbfb41..e0c15646 100644 --- a/ansible/extrafeature_tarball_config.yaml +++ b/ansible/extrafeature_tarball_config.yaml @@ -1,7 +1,3 @@ -- name: Set feature tarball dir - set_fact: - feature_dir: "{{ playbook_dir }}/files/osp/features/{{ osp.release }}/{{ feature }}" - - name: Get stats of the local feature dir stat: path="{{ feature_dir }}" diff --git a/ansible/osp_tripleo_deploy.yaml b/ansible/osp_tripleo_deploy.yaml index 987c5c63..16de2c79 100644 --- a/ansible/osp_tripleo_deploy.yaml +++ b/ansible/osp_tripleo_deploy.yaml @@ -49,6 +49,8 @@ # enable osp extra features parameters - include_tasks: extrafeature_heat_env.yaml + vars: + feature_dir: "{{ playbook_dir }}/templates/osp/tripleo_heat_envs/features/{{ osp.release }}/{{ feature }}" loop: "{{ osp.extrafeatures }}" loop_control: loop_var: feature @@ -70,6 +72,8 @@ # enable osp tarball extra features - include_tasks: extrafeature_tarball_config.yaml + vars: + ffeature_dir: "{{ playbook_dir }}/files/osp/features/{{ osp.release }}/{{ feature }}" loop: "{{ osp.extrafeatures }}" loop_control: loop_var: feature diff --git a/ansible/requirements.yml b/ansible/requirements.yml index 8476217a..b4f3b417 100644 --- a/ansible/requirements.yml +++ b/ansible/requirements.yml @@ -8,3 +8,4 @@ collections: - name: ansible.posix - name: containers.podman - name: community.general + - name: community.libvirt diff --git a/ansible/virt_sriov_vm.yaml b/ansible/virt_sriov_vm.yaml index 110f35d2..ed48d6e4 100644 --- a/ansible/virt_sriov_vm.yaml +++ b/ansible/virt_sriov_vm.yaml @@ -2,7 +2,7 @@ # This is separated from virt_sriov.yaml so that a loop can be used with all the tasks below # via an "include_tasks" task in that said file. It is not intended to run stand-alone. - name: Stop {{ item }} VM - virt: + community.libvirt.virt: name: "{{ item }}" state: destroyed @@ -48,4 +48,4 @@ failed_when: interface_removed.stderr != "" and "device not found" not in interface_removed.stderr - name: Attach e1000e OSP network device to {{ item }} VM - command: "virsh attach-device {{ item }} --file {{ xml_dir }}/osp-interface-new.xml --config" \ No newline at end of file + command: "virsh attach-device {{ item }} --file {{ xml_dir }}/osp-interface-new.xml --config"