Update deprecated 'play_hosts' with 'ansible_play_batch'

Ansible built-in variable 'play_hosts' has been deprecated since
release 2.2, and replaced by a new 'ansible_play_batch' variable
according to the official document below. We should reflect the
update to playbook site.yml.
link: http://docs.ansible.com/ansible/playbooks_variables.html

Change-Id: I937fe93ea893a3469019a0759ec57d2e91e8adab
Closes-Bug: #1694650
This commit is contained in:
Chen 2017-05-31 19:12:22 +09:00
parent 841bc75ae2
commit 4df02d66be

View File

@ -29,7 +29,7 @@
delegate_to: "{{ item }}"
with_items: "{{ groups['all'] }}"
when:
- (play_hosts | length) != (groups['all'] | length)
- (ansible_play_batch | length) != (groups['all'] | length)
- name: Detect openstack_release variable
hosts: all