Hi
I`m new in Ansible and try to spin up droplets at Digital Ocean Cloud.
Playbook works fine.
I would like to filter the return value “results” to display only ip_address and droplet id.
At the moment it shows all the json stuff from whole droplet.
tasks:
- name: Create Test Host at Digital Ocean
digital_ocean:
state: present
command: droplet
ssh_key_ids: *************
name: “{{ item.name }}”
api_token: ***************
size_id: 512mb
region_id: “{{ item.region }}”
image_id: ubuntu-14-04-x64
unique_name: yes
wait_timeout: 500
with_items:
- {name: “bfh01”, region: “nyc1”}
register: my_droplet
- name: Print IP-Address from Droplets
debug:
msg=“IP is {{ item.droplet.ip_address }}”
with_items: “{{ (my_droplet.results }}”
Thanks for help
Theo