tasks:
- name: Connect to Cloud
# assume RC file has already been sourced
os_auth:
- name: launch web instances
os_server:
name=web0{{ item }}
flavor={{ flavor }}
image={{ image }}
key_name={{ key_name }}
state=present
wait=true
network={{ network }}
security_groups={{ security_groups }}
auto_ip=true
register: newnodes
with_sequence:
count={{ count }}
# - debug:
# var: newnodes
- name: add nodes to runtime inventory
add_host:
name={{ item.name }}
# group=workers
# ansible_host={{ item.public_v4 }}
with_items:
- "{{ newnodes.results.server }}"
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.. This feature will be removed in a future release. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
newnodes.results.server' in the with_items section but no joy.