Skip to content

Commit 432e3d5

Browse files
authored
Merge pull request #87 from tibeer/fix/make-ansible-lint-happy
Make ansible lint happy
2 parents 50b6439 + 4075f9f commit 432e3d5

File tree

21 files changed

+82
-82
lines changed

21 files changed

+82
-82
lines changed

roles/ceph/tasks/mds.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
group: ceph
88
mode: "0770"
99
state: directory
10-
register: deploy_mds
10+
register: ceph_deploy_mds
1111
when: '"mds" in ceph_roles'
1212

1313
- name: Create mds keyring
1414
delegate_to: "{{ lookup('template', 'ceph.monitors.names.j2') | from_yaml | first }}"
1515
ansible.builtin.command:
1616
cmd: ceph auth get-or-create mds.{{ inventory_hostname_short }} mon 'profile mds' mgr 'profile mds' mds 'allow *' osd 'allow *'
17-
register: mds_keyring
18-
when: '"mds" in ceph_roles and deploy_mds.changed'
17+
register: ceph_mds_keyring
18+
when: '"mds" in ceph_roles and ceph_deploy_mds.changed'
1919
changed_when: true
2020

2121
- name: Transfer mds keyring
2222
ansible.builtin.copy:
23-
content: "{{ mds_keyring.stdout }}\n"
23+
content: "{{ ceph_mds_keyring.stdout }}\n"
2424
dest: "/var/lib/ceph/mds/ceph-{{ inventory_hostname_short }}/keyring"
2525
owner: ceph
2626
group: ceph
2727
mode: "0660"
28-
when: '"mds" in ceph_roles and deploy_mds.changed'
28+
when: '"mds" in ceph_roles and ceph_deploy_mds.changed'
2929

3030
- name: Enable ceph mds
3131
ansible.builtin.systemd:

roles/ceph/tasks/mgr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
group: ceph
88
mode: "0770"
99
state: directory
10-
register: deploy_mgr
10+
register: ceph_deploy_mgr
1111
when: '"mgr" in ceph_roles'
1212

1313
- name: Create mgr keyring
1414
delegate_to: "{{ lookup('template', 'ceph.monitors.names.j2') | from_yaml | first }}"
1515
ansible.builtin.command:
1616
cmd: ceph auth get-or-create mgr.{{ inventory_hostname_short }} mon 'allow profile mgr' osd 'allow *' mds 'allow *'
17-
register: mgr_keyring
18-
when: '"mgr" in ceph_roles and deploy_mgr.changed'
17+
register: ceph_mgr_keyring
18+
when: '"mgr" in ceph_roles and ceph_deploy_mgr.changed'
1919
changed_when: true
2020

2121
- name: Transfer mgr keyring
2222
ansible.builtin.copy:
23-
content: "{{ mgr_keyring.stdout }}\n"
23+
content: "{{ ceph_mgr_keyring.stdout }}\n"
2424
dest: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}/keyring"
2525
owner: ceph
2626
group: ceph
2727
mode: "0660"
28-
when: '"mgr" in ceph_roles and deploy_mgr.changed'
28+
when: '"mgr" in ceph_roles and ceph_deploy_mgr.changed'
2929

3030
- name: Enable ceph mgr
3131
ansible.builtin.systemd:

roles/ceph/tasks/repo_deb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
- name: Get local architecture
1919
ansible.builtin.command: dpkg --print-architecture
20-
register: dpkg_architecture
20+
register: ceph_dpkg_architecture
2121
changed_when: false
2222
check_mode: false
2323
when: 'ceph_roles|length > 0 and ceph_release != "distro"'

roles/ceph/tasks/rgw.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
group: ceph
88
mode: "0770"
99
state: directory
10-
register: deploy_rgw
10+
register: ceph_deploy_rgw
1111
when: '"rgw" in ceph_roles'
1212

1313
- name: Create Ceph rgw keyring
1414
delegate_to: "{{ lookup('template', 'ceph.monitors.names.j2') | from_yaml | first }}"
1515
ansible.builtin.command:
1616
cmd: ceph auth get-or-create client.rgw.{{ inventory_hostname_short }} mon 'allow rw' osd 'allow rwx'
17-
register: rgw_keyring
18-
when: '"rgw" in ceph_roles and deploy_rgw.changed'
17+
register: ceph_rgw_keyring
18+
when: '"rgw" in ceph_roles and ceph_deploy_rgw.changed'
1919
changed_when: true
2020

2121
- name: Transfer rgw keyring
2222
ansible.builtin.copy:
23-
content: "{{ rgw_keyring.stdout }}\n"
23+
content: "{{ ceph_rgw_keyring.stdout }}\n"
2424
dest: "/var/lib/ceph/radosgw/ceph-rgw.{{ inventory_hostname_short }}/keyring"
2525
owner: ceph
2626
group: ceph
2727
mode: "0660"
28-
when: '"rgw" in ceph_roles and deploy_rgw.changed'
28+
when: '"rgw" in ceph_roles and ceph_deploy_rgw.changed'
2929

3030
- name: Enable ceph rgw
3131
ansible.builtin.systemd:

roles/ceph/templates/ceph.sources.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Types: deb
33
URIs: https://download.ceph.com/debian-{{ ceph_release }}
44
Suites: {{ ansible_distribution_release }}
55
Components: main
6-
Architectures: {{ dpkg_architecture.stdout }}
6+
Architectures: {{ ceph_dpkg_architecture.stdout }}
77
Signed-By: /etc/apt/keyrings/ansible-ceph.asc

roles/incus/handlers/installation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
cluster:
1515
enabled: true
1616
cluster_address: "{{ incus_ip_address_or_default }}"
17-
cluster_token: "{{ cluster_add.stdout }}"
17+
cluster_token: "{{ incus_cluster_add.stdout }}"
1818
server_address: "{{ incus_ip_address_or_default }}"
1919
member_config:{%- for pool in incus_init.storage %}
2020
{%- for key in incus_init.storage[pool].local_config | default([]) %}

roles/incus/tasks/installation.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
- incus
77
install_recommends: false
88
state: present
9-
register: install_deb
9+
register: incus_install_deb
1010
when: 'ansible_distribution in ("Debian", "Ubuntu") and incus_roles | length > 0'
1111

1212
- name: Install the Incus package (rpm)
1313
ansible.builtin.package:
1414
name:
1515
- incus
1616
state: present
17-
register: install_rpm
17+
register: incus_install_rpm
1818
when: 'ansible_distribution == "CentOS" and incus_roles | length > 0'
1919

2020
- name: Install the Incus UI package (deb)
@@ -49,9 +49,9 @@
4949
- name: List installed kernel images
5050
ansible.builtin.command: >-
5151
apt list linux-image-* --installed
52-
register: linux_image_version
52+
register: incus_linux_image_version
5353
changed_when: false
54-
failed_when: "linux_image_version.rc != 0"
54+
failed_when: "incus_linux_image_version.rc != 0"
5555
when: >-
5656
incus_roles | length > 0 and 'zfs' in incus_init['storage'] |
5757
dict2items | json_query('[].value.driver') and ansible_distribution == 'Debian'
@@ -61,7 +61,7 @@
6161
name:
6262
- linux-headers-{{ item | regex_replace('^linux-image-(.*)/.*$', '\1') }}
6363
state: present
64-
loop: "{{ linux_image_version.stdout_lines | default([]) | select('search', 'linux-image-[0-9]+.*/.*') }}"
64+
loop: "{{ incus_linux_image_version.stdout_lines | default([]) | select('search', 'linux-image-[0-9]+.*/.*') }}"
6565
when: >-
6666
incus_roles | length > 0 and 'zfs' in incus_init['storage'] |
6767
dict2items | json_query('[].value.driver') and ansible_distribution == 'Debian'
@@ -84,39 +84,39 @@
8484

8585
- name: Set uid allocation
8686
ansible.builtin.command: "usermod root --add-subuids 10000000-1009999999"
87-
when: '(install_deb.changed or install_rpm.changed) and ansible_distribution == "CentOS"'
87+
when: '(incus_install_deb.changed or incus_install_rpm.changed) and ansible_distribution == "CentOS"'
8888
changed_when: true
8989

9090
- name: Set gid allocation
9191
ansible.builtin.command: "usermod root --add-subgids 10000000-1009999999"
92-
when: '(install_deb.changed or install_rpm.changed) and ansible_distribution == "CentOS"'
92+
when: '(incus_install_deb.changed or incus_install_rpm.changed) and ansible_distribution == "CentOS"'
9393
changed_when: true
9494

9595
- name: Enable incus socket unit
9696
ansible.builtin.systemd:
9797
enabled: true
9898
name: incus.socket
9999
state: started
100-
when: 'install_deb.changed or install_rpm.changed'
100+
when: 'incus_install_deb.changed or incus_install_rpm.changed'
101101

102102
- name: Enable incus service unit
103103
ansible.builtin.systemd:
104104
enabled: true
105105
name: incus.service
106106
state: started
107-
when: 'install_deb.changed or install_rpm.changed'
107+
when: 'incus_install_deb.changed or incus_install_rpm.changed'
108108

109109
- name: Enable incus startup unit
110110
ansible.builtin.systemd:
111111
enabled: true
112112
name: incus-startup.service
113113
state: started
114-
when: 'install_deb.changed or install_rpm.changed'
114+
when: 'incus_install_deb.changed or incus_install_rpm.changed'
115115

116116
- name: Set client listen address
117117
ansible.builtin.command: "incus --force-local config set core.https_address {{ incus_ip_address_or_default }}"
118118
when: >-
119-
(install_deb.changed or install_rpm.changed) and
119+
(incus_install_deb.changed or incus_install_rpm.changed) and
120120
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname))
121121
notify:
122122
- "Apply additional configuration"
@@ -125,7 +125,7 @@
125125

126126
- name: Set cluster listen address
127127
ansible.builtin.command: "incus --force-local config set cluster.https_address {{ incus_ip_address_or_default }}"
128-
when: '(install_deb.changed or install_rpm.changed) and "cluster" in incus_roles and incus_servers[0] == inventory_hostname'
128+
when: '(incus_install_deb.changed or incus_install_rpm.changed) and "cluster" in incus_roles and incus_servers[0] == inventory_hostname'
129129
changed_when: true
130130

131131
- name: Set OVN NorthBound database
@@ -137,7 +137,7 @@
137137
network.ovn.ca_cert="{{ lookup('file', ovn_config_dir + '/ca.crt') }}"
138138
notify: Restart Incus
139139
when: >-
140-
(install_deb.changed or install_rpm.changed) and
140+
(incus_install_deb.changed or incus_install_rpm.changed) and
141141
incus_ovn_northbound and
142142
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname))
143143
changed_when: true
@@ -149,7 +149,7 @@
149149
{% for k in item.value.config | default([]) %} {{ k }}={{ item.value.config[k] }}{% endfor %}
150150
loop: "{{ incus_init['network'] | dict2items }}"
151151
when: >-
152-
(install_deb.changed or install_rpm.changed) and
152+
(incus_install_deb.changed or incus_install_rpm.changed) and
153153
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname))
154154
changed_when: true
155155

@@ -158,7 +158,7 @@
158158
incus network set --property {{ item.key }} description="{{ item.value.description }}"
159159
loop: "{{ incus_init['network'] | dict2items }}"
160160
when: >-
161-
(install_deb.changed or install_rpm.changed) and
161+
(incus_install_deb.changed or incus_install_rpm.changed) and
162162
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname))
163163
and item.value.description is defined | default(None)
164164
changed_when: true
@@ -170,15 +170,15 @@
170170
{{ k }}={{ item.value.config[k] }}{% endfor %}
171171
loop: "{{ incus_init['storage'] | dict2items }}"
172172
when: >
173-
(install_deb.changed or install_rpm.changed) and
173+
(incus_install_deb.changed or incus_install_rpm.changed) and
174174
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname))
175175
changed_when: true
176176

177177
- name: Set storage pool description
178178
ansible.builtin.command: "incus storage set --property {{ item.key }} description=\"{{ item.value.description }}\""
179179
loop: "{{ incus_init['storage'] | dict2items }}"
180180
when: >
181-
(install_deb.changed or install_rpm.changed) and
181+
(incus_install_deb.changed or incus_install_rpm.changed) and
182182
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname)) and
183183
item.value.description is defined | default(None)
184184
changed_when: true
@@ -187,15 +187,15 @@
187187
ansible.builtin.command: "incus profile device add default root disk path=/ pool={{ item }}"
188188
loop: "{{ incus_init['storage'] | dict2items | json_query('[?value.default].key') }}"
189189
when: >
190-
(install_deb.changed or install_rpm.changed) and
190+
(incus_install_deb.changed or incus_install_rpm.changed) and
191191
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname))
192192
changed_when: true
193193

194194
- name: Add network to default profile
195195
ansible.builtin.command: "incus profile device add default eth0 nic network={{ item }} name=eth0"
196196
loop: "{{ incus_init['network'] | dict2items | json_query('[?value.default].key') }}"
197197
when: >
198-
(install_deb.changed or install_rpm.changed) and
198+
(incus_install_deb.changed or incus_install_rpm.changed) and
199199
("standalone" in incus_roles or ("cluster" in incus_roles and incus_servers[0] == inventory_hostname))
200200
changed_when: true
201201

@@ -204,24 +204,24 @@
204204
incus --force-local config
205205
set storage.linstor.controller_connection=http://{{ item }}:3370
206206
loop: "{{ ansible_play_hosts }}"
207-
register: register_linstor_controller
207+
register: incus_register_linstor_controller
208208
when: >-
209209
"controller" in hostvars[item]["ansible_facts"]["linstor_roles"] and
210210
ansible_distribution == "Ubuntu" and
211211
ansible_distribution_release != "focal"
212-
changed_when: "register_linstor_controller.rc == 0"
212+
changed_when: "incus_register_linstor_controller.rc == 0"
213213

214214
- name: Bootstrap the cluster
215215
ansible.builtin.command: "incus --force-local cluster enable {{ inventory_hostname }}"
216-
when: '(install_deb.changed or install_rpm.changed) and "cluster" in incus_roles and incus_servers[0] == inventory_hostname'
216+
when: '(incus_install_deb.changed or incus_install_rpm.changed) and "cluster" in incus_roles and incus_servers[0] == inventory_hostname'
217217
changed_when: true
218218

219219
- name: Create join tokens
220220
delegate_to: "{{ incus_servers[0] }}"
221221
ansible.builtin.command: "incus --force-local --quiet cluster add {{ inventory_hostname }}"
222-
register: cluster_add
222+
register: incus_cluster_add
223223
notify:
224224
- Wait 5s to avoid token use before valid
225225
- Join the cluster
226-
when: '(install_deb.changed or install_rpm.changed) and "cluster" in incus_roles and incus_servers[0] != inventory_hostname'
226+
when: '(incus_install_deb.changed or incus_install_rpm.changed) and "cluster" in incus_roles and incus_servers[0] != inventory_hostname'
227227
changed_when: true

roles/incus/tasks/repo_deb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
- name: Get DPKG architecture
1919
ansible.builtin.command: dpkg --print-architecture
20-
register: dpkg_architecture
20+
register: incus_dpkg_architecture
2121
changed_when: false
2222
check_mode: false
2323
when: 'incus_roles|length > 0 and incus_release != "distro" and ansible_distribution in ("Ubuntu", "Debian")'

roles/incus/templates/incus.sources.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Types: deb
44
URIs: https://pkgs.zabbly.com/incus/{{ incus_release }}/
55
Suites: {{ ansible_distribution_release }}
66
Components: main
7-
Architectures: {{ dpkg_architecture.stdout }}
7+
Architectures: {{ incus_dpkg_architecture.stdout }}
88
Signed-By: /etc/apt/keyrings/ansible-zabbly.asc

roles/linstor/tasks/installation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
- name: List installed linux images
44
ansible.builtin.command: >-
55
apt list linux-image-* --installed
6-
register: linux_image_version
6+
register: linstor_linux_image_version
77
changed_when: false
8-
failed_when: "linux_image_version.rc != 0"
8+
failed_when: "linstor_linux_image_version.rc != 0"
99
when: '"satellite" in linstor_roles'
1010

1111
- name: Install linux image headers
1212
ansible.builtin.apt:
1313
name:
1414
- linux-headers-{{ item | regex_replace('^linux-image-(.*)/.*$', '\1') }}
1515
state: present
16-
loop: "{{ linux_image_version.stdout_lines | default([]) | select('search', 'linux-image-[0-9]+.*/.*') }}"
16+
loop: "{{ linstor_linux_image_version.stdout_lines | default([]) | select('search', 'linux-image-[0-9]+.*/.*') }}"
1717
when: '"satellite" in linstor_roles'
1818

1919
- name: Install linstor-satellite

0 commit comments

Comments
 (0)