Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Creating a new instance
- os_server:
- state: present
- auth:
- auth_url: "{{ auth_url }}"
- username: "{{ username }}"
- password: "{{ password }}"
- project_name: "{{ project_name }}"
- name: "{{ item.hostname }}"
- image: "{{ item.image }}"
- availability_zone: zoneA
- #key_name: automation
- timeout: 200
- flavor: "{{ item.flavor }}"
- nics: "{{ nics }}"
- with_items: "{{ servers }}"
- register: "os_hosts"
- - name: add hosts to inventory
- add_host:
- name: "{{ item[1].server.addresses["provider-nmnet-bif-912"][0]["addr"] }}"
- groups: BIF
- ansible_user: admin
- instance_name: test
- with_nested:
- - "{{ servers }}"
- - "{{ os_hosts.results }}"
- when: item[0].server == "BIF"
Add Comment
Please, Sign In to add comment