From fad49117dc95ea5b59987cc1775fccce5fcc5849 Mon Sep 17 00:00:00 2001 From: Will Song Date: Wed, 5 Jan 2022 12:15:33 -0500 Subject: [PATCH] fix digitalocean by updating ipv4 address json path the current api format is documented at https://docs.digitalocean.com/reference/api/api-reference/#operation/get_droplet if it changes again one can just update the path with some profound observations --- config.cfg | 4 +--- roles/cloud-digitalocean/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config.cfg b/config.cfg index 1c93e74..46adaff 100644 --- a/config.cfg +++ b/config.cfg @@ -6,9 +6,7 @@ # User names with leading 0's or containing only numbers should be escaped in double quotes, e.g. "000dan" or "123". # Email addresses are not allowed. users: - - phone - - laptop - - desktop + - test ### Review these options BEFORE you run Algo, as they are very difficult/impossible to change after the server is deployed. diff --git a/roles/cloud-digitalocean/tasks/main.yml b/roles/cloud-digitalocean/tasks/main.yml index 2013a22..b1a7e47 100644 --- a/roles/cloud-digitalocean/tasks/main.yml +++ b/roles/cloud-digitalocean/tasks/main.yml @@ -40,7 +40,7 @@ when: alternative_ingress_ip - set_fact: - cloud_instance_ip: "{{ digital_ocean_droplet.data.ip_address }}" + cloud_instance_ip: "{{ digital_ocean_droplet.data.droplet.networks.v4[0].ip_address }}" ansible_ssh_user: algo ansible_ssh_port: "{{ ssh_port }}" cloudinit: true