Address Ansible bare variable usage

When executing the bootstrap-host 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.

Change-Id: I5e5dba540256935ffb03ace27c6c43abc15f52da
This commit is contained in:
Jesse Pretorius 2016-06-14 12:51:15 +01:00 committed by Major Hayden
parent d83c889631
commit 19ac766bf6
8 changed files with 18 additions and 16 deletions

View File

@ -68,8 +68,8 @@
# If I'm correct, the use case for multiple users is on the computre nodes,
# access needed by users libvirt-qemu and nova
mode: 0640
with_items: ceph_client_keyrings.results
when: not item|skipped and inventory_hostname in groups[item.item.0.component]
with_items: "{{ ceph_client_keyrings.results }}"
when: not item | skipped and inventory_hostname in groups[item.item.0.component]
notify:
- Restart os services
tags:

View File

@ -20,7 +20,7 @@
# failed_when: false is needed to not loose any hosts, as this check expects
# some to be down.
local_action: command nc -w 1 {{ item }} 22
with_items: '{{ ceph_mons }}'
with_items: "{{ ceph_mons }}"
changed_when: false
failed_when: false
register: ceph_mon_upcheck
@ -33,7 +33,7 @@
set_fact:
ceph_mon_host: '{{ item.item }}'
when: item.rc == 0 and "OpenSSH" in item.stdout
with_items: ceph_mon_upcheck.results
with_items: "{{ ceph_mon_upcheck.results }}"
tags:
- ceph-config-create-config
- ceph-auth-client-keyrings

View File

@ -18,7 +18,7 @@
id: "{{ item }}"
state: "absent"
register: revoke_keys
with_items: ceph_revoked_gpg_keys
with_items: "{{ ceph_revoked_gpg_keys }}"
when: ceph_pkg_source == 'ceph'
tags:
- ceph-apt-keys
@ -35,7 +35,7 @@
ignore_errors: True
retries: 5
delay: 2
with_items: ceph_gpg_keys
with_items: "{{ ceph_gpg_keys }}"
when: ceph_pkg_source == 'ceph'
tags:
- ceph-apt-keys
@ -50,7 +50,7 @@
until: add_keys_fallback|success
retries: 5
delay: 2
with_items: ceph_gpg_keys
with_items: "{{ ceph_gpg_keys }}"
when: ceph_pkg_source == 'ceph' and
add_keys|failed and
(item.fallback_keyserver is defined or

View File

@ -44,7 +44,7 @@
until: install_packages|success
retries: 5
delay: 2
with_items: haproxy_packages
with_items: "{{ haproxy_packages }}"
tags:
- haproxy-apt-packages
@ -56,4 +56,4 @@
when:
- ansible_distribution_version | version_compare('16.04', '<')
tags:
- haproxy-config
- haproxy-config

View File

@ -21,6 +21,6 @@
until: install_packages|success
retries: 5
delay: 2
with_items: haproxy_packages
with_items: "{{ haproxy_packages }}"
tags:
- haproxy-yum-packages

View File

@ -17,7 +17,7 @@
template:
src: service.j2
dest: "/etc/haproxy/conf.d/{{ item.service.haproxy_service_name }}"
with_items: haproxy_service_configs
with_items: "{{ haproxy_service_configs }}"
when: >
(item.service.haproxy_backend_nodes is defined and
item.service.haproxy_backend_nodes | length > 0) or

View File

@ -23,7 +23,9 @@
with_items:
- { src: "{{ haproxy_user_ssl_cert }}", dest: "{{ haproxy_ssl_cert }}", mode: "0644" }
- { src: "{{ haproxy_user_ssl_key }}", dest: "{{ haproxy_ssl_key }}", mode: "0640" }
when: haproxy_user_ssl_cert is defined and haproxy_user_ssl_key is defined
when:
- haproxy_user_ssl_cert is defined
- haproxy_user_ssl_key is defined
notify:
- regen pem
tags:

View File

@ -72,7 +72,7 @@
apt:
name: "{{ item }}"
state: absent
with_items: packages_remove
with_items: "{{ packages_remove }}"
tags:
- remove-packages
@ -80,7 +80,7 @@
apt:
name: "{{ item }}"
state: present
with_items: packages_install
with_items: "{{ packages_install }}"
tags:
- install-packages
@ -88,7 +88,7 @@
apt:
name: "{{ item }}"
state: present
with_items: packages_mongodb
with_items: "{{ packages_mongodb }}"
when: bootstrap_host_mongodb_service | bool
tags:
- install-mongodb
@ -97,7 +97,7 @@
apt:
name: "{{ item }}"
state: present
with_items: packages_libvirt
with_items: "{{ packages_libvirt }}"
when: bootstrap_host_libvirt_config | bool
tags:
- install-libvirt