mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-06 15:13:56 +02:00
parent
b29b310ff3
commit
e416e76ce8
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,6 @@
|
||||||
skip_list:
|
skip_list:
|
||||||
- '204'
|
- '204'
|
||||||
verbosity: 1
|
verbosity: 1
|
||||||
|
|
||||||
|
warn_list:
|
||||||
|
- no-changed-when
|
||||||
|
|
|
@ -26,12 +26,16 @@
|
||||||
- Environment:Algo
|
- Environment:Algo
|
||||||
register: digital_ocean_droplet
|
register: digital_ocean_droplet
|
||||||
|
|
||||||
|
# Return data is not idempotent
|
||||||
|
- set_fact:
|
||||||
|
droplet: "{{ digital_ocean_droplet.data.droplet | default(digital_ocean_droplet.data) }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: "Create a Floating IP"
|
- name: "Create a Floating IP"
|
||||||
digital_ocean_floating_ip:
|
digital_ocean_floating_ip:
|
||||||
state: present
|
state: present
|
||||||
oauth_token: "{{ algo_do_token }}"
|
oauth_token: "{{ algo_do_token }}"
|
||||||
droplet_id: "{{ digital_ocean_droplet.data.droplet.id }}"
|
droplet_id: "{{ droplet.id }}"
|
||||||
register: digital_ocean_floating_ip
|
register: digital_ocean_floating_ip
|
||||||
|
|
||||||
- name: Set the static ip as a fact
|
- name: Set the static ip as a fact
|
||||||
|
@ -40,7 +44,7 @@
|
||||||
when: alternative_ingress_ip
|
when: alternative_ingress_ip
|
||||||
|
|
||||||
- set_fact:
|
- 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_user: algo
|
||||||
ansible_ssh_port: "{{ ssh_port }}"
|
ansible_ssh_port: "{{ ssh_port }}"
|
||||||
cloudinit: true
|
cloudinit: true
|
||||||
|
|
Loading…
Add table
Reference in a new issue