Skip to content

Commit 713d62c

Browse files
committed
Fix all ansible-lint issues
1 parent 15d3b55 commit 713d62c

File tree

218 files changed

+7612
-8124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+7612
-8124
lines changed

.ansible-lint

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
---
12
skip_list:
2-
- '204'
3-
- '301'
4-
- '306'
5-
- '602'
6-
- '701'
7-
- 'ignore-errors'
3+
- "no-changed-when"
4+
- "ignore-errors"
5+
- "name[template]"
6+
- "risky-shell-pipe"
87

98
# warn_list: # or 'skip_list' to silence them completely
109

@@ -13,6 +12,7 @@ exclude_paths:
1312
- ansible/files
1413
- ansible/roles/cnosp/files
1514
- .github/workflows
15+
- .ansible
1616

1717
kinds:
1818
- tasks: "**/*_tasks.yaml"

.ansible-lint-ignore

Lines changed: 0 additions & 645 deletions
This file was deleted.

ansible/cnosp_ctlplane_cleanup.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
---
2-
- hosts: localhost
2+
- name: CNOSP Cleanup
3+
hosts: localhost
34
vars_files: vars/default.yaml
45
roles:
5-
- oc_local
6+
- oc_local
67

78
tasks:
8-
- name: Delete the ctlplane
9-
include_role:
10-
name: cnosp
11-
tasks_from: ctlplane_cleanup
9+
- name: Delete the ctlplane
10+
ansible.builtin.include_role:
11+
name: cnosp
12+
tasks_from: ctlplane_cleanup
1213

13-
- name: Delete OVN
14-
include_role:
15-
name: cnosp
16-
tasks_from: ovn_cleanup
14+
- name: Delete OVN
15+
ansible.builtin.include_role:
16+
name: cnosp
17+
tasks_from: ovn_cleanup
1718

18-
- name: Delete cnosp openstackclient
19-
include_role:
20-
name: cnosp
21-
tasks_from: openstackclient_cleanup
19+
- name: Delete cnosp openstackclient
20+
ansible.builtin.include_role:
21+
name: cnosp
22+
tasks_from: openstackclient_cleanup

ansible/cnosp_ctlplane_deploy.yaml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
---
2-
- hosts: convergence_base
2+
- name: CNOSP Prepare NFS service for cinder
3+
hosts: convergence_base
34
gather_facts: false
45
become: true
56
user: root
67
vars_files: vars/default.yaml
78

89
tasks:
9-
- name: Prepare NFS service for cinder
10-
include_role:
11-
name: cnosp
12-
tasks_from: cinder_nfs_prepare
10+
- name: Prepare NFS service for cinder
11+
ansible.builtin.include_role:
12+
name: cnosp
13+
tasks_from: cinder_nfs_prepare
1314

14-
- hosts: localhost
15+
- name: CNOSP ControlPlane
16+
hosts: localhost
1517
vars_files: vars/default.yaml
1618
roles:
17-
- oc_local
19+
- oc_local
1820

1921
tasks:
20-
- name: Config OSP ctlplane services
21-
include_role:
22-
name: cnosp
23-
tasks_from: ctlplane_config
22+
- name: Config OSP ctlplane services
23+
ansible.builtin.include_role:
24+
name: cnosp
25+
tasks_from: ctlplane_config
2426

25-
- name: Setup OVN
26-
include_role:
27-
name: cnosp
28-
tasks_from: ovn_install
27+
- name: Setup OVN
28+
ansible.builtin.include_role:
29+
name: cnosp
30+
tasks_from: ovn_install
2931

30-
- name: Deploy the ctlplane
31-
include_role:
32-
name: cnosp
33-
tasks_from: ctlplane_deploy
32+
- name: Deploy the ctlplane
33+
ansible.builtin.include_role:
34+
name: cnosp
35+
tasks_from: ctlplane_deploy
3436

35-
- name: Deploy the cnosp openstackclient
36-
include_role:
37-
name: cnosp
38-
tasks_from: openstackclient_install
37+
- name: Deploy the cnosp openstackclient
38+
ansible.builtin.include_role:
39+
name: cnosp
40+
tasks_from: openstackclient_install

ansible/cnosp_olm.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env ansible-playbook
22
---
3-
- hosts: localhost
3+
- name: CNOSP OLM
4+
hosts: localhost
45
vars_files: "vars/default.yaml"
56
roles:
6-
- oc_local
7+
- oc_local
78

89
tasks:
9-
- name: Deploy cnosp operators
10-
include_role:
11-
name: cnosp
12-
tasks_from: olm
13-
vars:
14-
_csv_version: "{{ cnosp_csv_version }}"
15-
10+
- name: Deploy cnosp operators
11+
ansible.builtin.include_role:
12+
name: cnosp
13+
tasks_from: olm
14+
vars:
15+
_csv_version: "{{ cnosp_csv_version }}" # noqa: var-naming[no-role-prefix]

ansible/cnosp_olm_cleanup.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env ansible-playbook
22
---
3-
- hosts: localhost
3+
- name: CNOSP OLM Cleanup
4+
hosts: localhost
45
vars_files: "vars/default.yaml"
56
roles:
6-
- oc_local
7+
- oc_local
78

89
tasks:
9-
- name: Deinstall cnosp operators
10-
include_role:
11-
name: cnosp
12-
tasks_from: olm_cleanup
13-
vars:
14-
_csv_version: "{{ cnosp_csv_version }}"
10+
- name: Deinstall cnosp operators
11+
ansible.builtin.include_role:
12+
name: cnosp
13+
tasks_from: olm_cleanup
14+
vars:
15+
_csv_version: "{{ cnosp_csv_version }}" # noqa: var-naming[no-role-prefix]

ansible/config_generator.yaml

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,77 @@
11
---
2-
- hosts: localhost
2+
- name: ConfigGenerator
3+
hosts: localhost
34
vars_files: vars/default.yaml
45
roles:
5-
- oc_local
6+
- oc_local
67

78
tasks:
8-
- name: Set combined osp dict
9-
set_fact:
10-
osp: "{{ osp_defaults | combine((osp_release_defaults | default({})), recursive=True) | combine((osp_local | default({})), recursive=True) }}"
9+
- name: Set combined osp dict
10+
ansible.builtin.set_fact:
11+
osp: "{{ osp_defaults | combine((osp_release_defaults | default({})), recursive=True) | combine((osp_local | default({})), recursive=True) }}"
1112

12-
- name: Set directory for generator yaml files
13-
set_fact:
14-
config_generator_yaml_dir: "{{ working_yamls_dir }}/config_generator_{{ config_generator_name|default('default') }}"
13+
- name: Set directory for generator yaml files
14+
ansible.builtin.set_fact:
15+
config_generator_yaml_dir: "{{ working_yamls_dir }}/config_generator_{{ config_generator_name | default('default') }}"
1516

16-
- name: show yaml output dir
17-
debug:
18-
msg: "yamls will be written to {{ config_generator_yaml_dir }} locally"
17+
- name: Show yaml output dir
18+
ansible.builtin.debug:
19+
msg: "yamls will be written to {{ config_generator_yaml_dir }} locally"
1920

20-
- name: Clean yaml dir
21-
file:
22-
state: absent
23-
path: "{{ config_generator_yaml_dir }}/"
21+
- name: Clean yaml dir
22+
ansible.builtin.file:
23+
state: absent
24+
path: "{{ config_generator_yaml_dir }}/"
2425

25-
- name: Create yaml dir
26-
file:
27-
path: "{{ config_generator_yaml_dir }}"
28-
state: directory
29-
mode: '0755'
26+
- name: Create yaml dir
27+
ansible.builtin.file:
28+
path: "{{ config_generator_yaml_dir }}"
29+
state: directory
30+
mode: "0755"
3031

31-
- name: Render templates to yaml dir
32-
template:
33-
src: "osp/config_generator/{{ item }}.j2"
34-
dest: "{{ config_generator_yaml_dir }}/{{ item }}"
35-
mode: '0644'
36-
with_items:
37-
- "openstackconfiggenerator.yaml"
32+
- name: Render templates to yaml dir
33+
ansible.builtin.template:
34+
src: "osp/config_generator/{{ item }}.j2"
35+
dest: "{{ config_generator_yaml_dir }}/{{ item }}"
36+
mode: "0644"
37+
with_items:
38+
- "openstackconfiggenerator.yaml"
3839

39-
- name: Check if config generator exists
40-
environment: &oc_env
41-
PATH: "{{ oc_env_path }}"
42-
KUBECONFIG: "{{ kubeconfig }}"
43-
ignore_errors: true
44-
command: oc get osconfiggenerator -n openstack {{ config_generator_name|default('default') }} -o name
45-
register: osconfiggen_check_exists
40+
- name: Check if config generator exists
41+
environment: &oc_env
42+
PATH: "{{ oc_env_path }}"
43+
KUBECONFIG: "{{ kubeconfig }}"
44+
ignore_errors: true
45+
ansible.builtin.command: oc get osconfiggenerator -n openstack {{ config_generator_name | default('default') }} -o name
46+
register: osconfiggen_check_exists
4647

47-
- set_fact:
48-
osconfiggen_exists: "{{ osconfiggen_check_exists.rc == 0 }}"
48+
- name: Set fact
49+
ansible.builtin.set_fact:
50+
osconfiggen_exists: "{{ osconfiggen_check_exists.rc == 0 }}"
4951

50-
- name: Start config generator
51-
shell: |
52-
set -e
53-
oc apply -n openstack -f "{{ config_generator_yaml_dir }}/openstackconfiggenerator.yaml"
54-
environment:
55-
<<: *oc_env
56-
when: osconfiggen_exists|bool == false
52+
- name: Start config generator
53+
ansible.builtin.shell: |
54+
set -e
55+
oc apply -n openstack -f "{{ config_generator_yaml_dir }}/openstackconfiggenerator.yaml"
56+
environment:
57+
<<: *oc_env
58+
when: not osconfiggen_exists | bool
5759

58-
- name: Refresh config generator image
59-
shell: |
60-
oc patch osconfiggenerator -n openstack {{ config_generator_name|default('default') }} --type=json -p="[
61-
{'op': 'remove', 'path': '/spec/imageURL'}
62-
]"
63-
environment:
64-
<<: *oc_env
65-
when:
66-
- config_generator_update_image|default(False)
67-
- osconfiggen_exists|bool
60+
- name: Refresh config generator image
61+
ansible.builtin.shell: |
62+
oc patch osconfiggenerator -n openstack {{ config_generator_name | default('default') }} --type=json -p="[
63+
{'op': 'remove', 'path': '/spec/imageURL'}
64+
]"
65+
environment:
66+
<<: *oc_env
67+
when:
68+
- config_generator_update_image | default(False)
69+
- osconfiggen_exists | bool
6870

69-
- name: wait for config generator to finish
70-
shell: |
71-
set -e
72-
oc wait -n openstack osconfiggenerator {{ config_generator_name|default('default') }} --for condition=Finished --timeout="{{ (default_timeout * 20)|int }}s"
73-
environment:
74-
<<: *oc_env
71+
- name: Wait for config generator to finish
72+
ansible.builtin.shell: |
73+
set -e
74+
oc wait -n openstack osconfiggenerator {{ config_generator_name | default('default') }} \
75+
--for condition=Finished --timeout="{{ (default_timeout * 20) | int }}s"
76+
environment:
77+
<<: *oc_env

0 commit comments

Comments
 (0)