Skip to content

Commit 0afc625

Browse files
committed
Fix deprecation warnings for Ansible 2.6 (#30)
Merge branch 'feature/cleanup_warnings' into develop
2 parents 42495cc + a6f535b commit 0afc625

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Finally, let's write our playbook. `site.yml` will look something like this:
277277
- name: Wait for server to come back online
278278
wait_for_connection:
279279
delay: 15
280-
when: __configure_interfaces | changed
280+
when: __configure_interfaces is changed
281281
282282
- hosts: pve
283283
become: True

tasks/disable_nmi_watchdog.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
register: __pve_rmmod_softdog
1313

1414
- block:
15-
1615
- name: Stop watchdog-mux
1716
service:
1817
name: watchdog-mux
@@ -25,7 +24,7 @@
2524
name: softdog
2625
state: absent
2726

28-
when: __pve_rmmod_softdog|failed
27+
when: __pve_rmmod_softdog is failed
2928

3029
- name: Disable nmi_watchdog via GRUB config
3130
lineinfile:
@@ -38,5 +37,5 @@
3837
command: update-grub
3938
register: __pve_grub_update
4039
failed_when: ('error' in __pve_grub_update.stderr)
41-
when: __pve_grub|changed
40+
when: __pve_grub is changed
4241
tags: skiponlxc

tasks/ipmi_watchdog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- include: disable_nmi_watchdog.yml
2+
- import_tasks: disable_nmi_watchdog.yml
33

44
- name: Load ipmi_watchdog module
55
modprobe:

tasks/kernel_module_cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
command: update-grub
2727
register: __pve_grub_update
2828
failed_when: ('error' in __pve_grub_update.stderr)
29-
when: __pve_grub|changed
29+
when: __pve_grub is changed
3030
tags: skiponlxc
3131

3232
- name: Remove ipmi_watchdog modprobe configuration

tasks/main.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
msg: "This host does not appear to be in the group {{ pve_group }}, did you specify the pve_group host variable correctly?"
1616
when: pve_cluster_enabled
1717

18-
- include: ssh_cluster_config.yml
18+
- import_tasks: ssh_cluster_config.yml
1919

2020
- name: Run handlers if needed (sshd reload)
2121
meta: flush_handlers
@@ -76,7 +76,7 @@
7676
upgrade: yes
7777
when: pve_run_system_upgrades
7878

79-
- include: identify_needed_packages.yml
79+
- import_tasks: identify_needed_packages.yml
8080

8181
- name: Install Proxmox VE and related packages
8282
apt:
@@ -108,41 +108,49 @@
108108
when:
109109
- "'pve-no-subscription' in pve_repository_line"
110110

111-
- include: kernel_updates.yml
111+
- import_tasks: kernel_updates.yml
112112

113-
- include: ipmi_watchdog.yml
113+
- import_tasks: ipmi_watchdog.yml
114114
when: pve_watchdog == 'ipmi'
115115

116-
- include: zfs.yml
116+
- import_tasks: zfs.yml
117117
when: pve_zfs_enabled
118118

119-
- include: kernel_module_cleanup.yml
119+
- import_tasks: kernel_module_cleanup.yml
120120

121-
- include: pve_cluster_config.yml
121+
- import_tasks: pve_cluster_config.yml
122122
when: pve_cluster_enabled
123123

124124
- name: Configure Proxmox groups
125125
proxmox_group:
126-
args: "{{ item }}"
126+
name: "{{ item.name }}"
127+
comment: "{{ item.comment | default(omit) }}"
127128
with_items: "{{ pve_groups }}"
128129
when: "not pve_cluster_enabled or (pve_cluster_enabled and inventory_hostname == groups[pve_group][0])"
129130

130131
- name: Configure Proxmox user accounts
131132
proxmox_user:
132-
args: "{{ item }}"
133+
name: "{{ item.name }}"
134+
email: "{{ item.email | default(omit) }}"
135+
firstname: "{{ item.firstname | default(omit) }}"
136+
lastname: "{{ item.lastname | default(omit) }}"
137+
groups: "{{ item.groups | default([]) }}"
133138
with_items: "{{ pve_users }}"
134139
when: "not pve_cluster_enabled or (pve_cluster_enabled and inventory_hostname == groups[pve_group][0])"
135140

136141
- name: Configure Proxmox ACLs
137142
proxmox_acl:
138-
args: "{{ item }}"
143+
path: "{{ item.path }}"
144+
roles: "{{ item.roles }}"
145+
groups: "{{ item.groups | default([]) }}"
146+
users: "{{ item.users | default([]) }}"
139147
with_items: "{{ pve_acls }}"
140148
when: "not pve_cluster_enabled or (pve_cluster_enabled and inventory_hostname == groups[pve_group][0])"
141149

142-
- include: ssl_config.yml
150+
- import_tasks: ssl_config.yml
143151
when:
144152
- pve_ssl_private_key is defined
145153
- pve_ssl_certificate is defined
146154

147-
- include: ssl_letsencrypt.yml
155+
- import_tasks: ssl_letsencrypt.yml
148156
when: pve_ssl_letsencrypt

0 commit comments

Comments
 (0)