mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-02 10:53:01 +02:00
DO networks fix
This commit is contained in:
parent
a103d8dd16
commit
3ab6195bd0
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue