Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
skip_list:
- '204'
verbosity: 1

warn_list:
- no-changed-when
8 changes: 6 additions & 2 deletions roles/cloud-digitalocean/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@
- Environment:Algo
register: digital_ocean_droplet

# Return data is not idempotent
- set_fact:
droplet: "{{ digital_ocean_droplet.data.droplet | default(digital_ocean_droplet.data) }}"

- block:
- name: "Create a Floating IP"
digital_ocean_floating_ip:
state: present
oauth_token: "{{ algo_do_token }}"
droplet_id: "{{ digital_ocean_droplet.data.droplet.id }}"
droplet_id: "{{ droplet.id }}"
register: digital_ocean_floating_ip

- name: Set the static ip as a fact
Expand All @@ -40,7 +44,7 @@
when: alternative_ingress_ip

- set_fact:
cloud_instance_ip: "{{ digital_ocean_droplet.data.droplet.networks.v4.0.ip_address }}"
cloud_instance_ip: "{{ (droplet.networks.v4 | selectattr('type', '==', 'public')).0.ip_address }}"
ansible_ssh_user: algo
ansible_ssh_port: "{{ ssh_port }}"
cloudinit: true