Skip to content

Commit

Permalink
Fix ansible-lint by pinning it to 5.3.2 version
Browse files Browse the repository at this point in the history
Due to recent issue in the ansible-lint package we need to
bump version which we are using:
  ansible/ansible-lint#1795

Fix ansible-lint errors revealed by new ansible-lint.
  • Loading branch information
mpryc committed Jan 13, 2022
1 parent 969ee68 commit e2333bb
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions .github/workflows/ansible-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions ansible/datavolume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions ansible/datavolume_tasks.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 2 additions & 5 deletions ansible/extrafeature_heat_env.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 0 additions & 4 deletions ansible/extrafeature_tarball_config.yaml
Original file line number Diff line number Diff line change
@@ -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 }}"
Expand Down
4 changes: 4 additions & 0 deletions ansible/osp_tripleo_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ collections:
- name: ansible.posix
- name: containers.podman
- name: community.general
- name: community.libvirt
4 changes: 2 additions & 2 deletions ansible/virt_sriov_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
command: "virsh attach-device {{ item }} --file {{ xml_dir }}/osp-interface-new.xml --config"

0 comments on commit e2333bb

Please sign in to comment.