Address Ansible bare variable usage
When executing the role with Ansible 2.1, the following deprecation warning is issued in the output for some tasks. [DEPRECATION WARNING]: Using bare variables is deprecated. This patch addresses the tasks to fix the behaviour appropriately. The patch also addresses removing the use of with_items if the list only contains a single item. Change-Id: I8326d53d3a57fd84a55febc21f6ae1a64fced415
This commit is contained in:
parent
ef6f746bed
commit
cbf79113c4
@ -74,7 +74,7 @@
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
state: present
|
||||
with_items: lxc_cache_sshd_configuration
|
||||
with_items: "{{ lxc_cache_sshd_configuration }}"
|
||||
tags:
|
||||
- lxc-cache
|
||||
- lxc-cache-update
|
||||
|
@ -34,6 +34,6 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: lxc_pip_packages
|
||||
with_items: "{{ lxc_pip_packages }}"
|
||||
tags:
|
||||
- lxc-pip-packages
|
||||
|
@ -38,7 +38,7 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: lxc_packages
|
||||
with_items: "{{ lxc_packages }}"
|
||||
tags:
|
||||
- lxc-apt-packages
|
||||
|
||||
|
@ -21,18 +21,16 @@
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: lxc_packages
|
||||
with_items: "{{ lxc_packages }}"
|
||||
tags:
|
||||
- lxc-packages
|
||||
|
||||
- name: Create base directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
path: "/opt/lxc_embedded"
|
||||
state: "directory"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
with_items:
|
||||
- /opt/lxc_embedded
|
||||
tags:
|
||||
- lxc-directories
|
||||
|
||||
@ -118,12 +116,10 @@
|
||||
|
||||
- name: Remove sub system lock if found
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
path: "/var/lock/subsys/lxc"
|
||||
state: "absent"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
with_items:
|
||||
- /var/lock/subsys/lxc
|
||||
tags:
|
||||
- lxc-directories
|
||||
|
||||
|
@ -21,4 +21,4 @@
|
||||
state: "{{ item.state|default('present') }}"
|
||||
reload: "{{ item.reload|default('yes') }}"
|
||||
ignore_errors: true
|
||||
with_items: lxc_kernel_options
|
||||
with_items: "{{ lxc_kernel_options }}"
|
||||
|
Loading…
Reference in New Issue
Block a user