From eb02a3f99dccb95bcb94eb428e7e19c88667f7e1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 8 Sep 2019 02:24:27 +0200 Subject: some more refactoring and cleanup of cloud install roles --- roles/cloud/install/tasks/hcloud.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'roles/cloud/install/tasks/hcloud.yml') diff --git a/roles/cloud/install/tasks/hcloud.yml b/roles/cloud/install/tasks/hcloud.yml index ca5435b8..646d80da 100644 --- a/roles/cloud/install/tasks/hcloud.yml +++ b/roles/cloud/install/tasks/hcloud.yml @@ -4,17 +4,17 @@ url: "https://api.hetzner.cloud/v1/ssh_keys" method: GET headers: - Authorization: "Bearer {{ install_cooked.cloud_credentials.token }}" + Authorization: "Bearer {{ install_cooked.cloud.credentials.token }}" status_code: 200 register: sshkeys delegate_to: localhost - name: retrieve server id and check if rescue mode is already active uri: - url: "https://api.hetzner.cloud/v1/servers?name={{ inventory_hostname }}" + url: "https://api.hetzner.cloud/v1/servers?name={{ install_cooked.cloud.server_name | default(inventory_hostname) }}" method: GET headers: - Authorization: "Bearer {{ install_cooked.cloud_credentials.token }}" + Authorization: "Bearer {{ install_cooked.cloud.credentials.token }}" status_code: 200 register: serverstatus delegate_to: localhost @@ -33,7 +33,7 @@ method: POST body: "{{ {'type': 'linux64', 'ssh_keys': (sshkeys.json.ssh_keys | map(attribute='id') | list) } | to_nice_json }}" headers: - Authorization: "Bearer {{ install_cooked.cloud_credentials.token }}" + Authorization: "Bearer {{ install_cooked.cloud.credentials.token }}" Content-Type: "application/json" status_code: 201 delegate_to: localhost @@ -43,7 +43,7 @@ url: "https://api.hetzner.cloud/v1/servers/{{ serverstatus.json.servers[0].id }}/actions/reset" method: POST headers: - Authorization: "Bearer {{ install_cooked.cloud_credentials.token }}" + Authorization: "Bearer {{ install_cooked.cloud.credentials.token }}" status_code: 201 delegate_to: localhost -- cgit v1.2.3