mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-07 15:43:54 +02:00
Fix hetzner module
This commit is contained in:
parent
74051d06a2
commit
fdb50ae6cf
3 changed files with 4 additions and 14 deletions
|
@ -1,12 +1,9 @@
|
||||||
---
|
---
|
||||||
- name: Build python virtual environment
|
|
||||||
import_tasks: venv.yml
|
|
||||||
|
|
||||||
- name: Include prompts
|
- name: Include prompts
|
||||||
import_tasks: prompts.yml
|
import_tasks: prompts.yml
|
||||||
|
|
||||||
- name: Create an ssh key
|
- name: Create an ssh key
|
||||||
hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: algo-{{ 999999 | random(seed=lookup('file', SSH_keys.public)) }}
|
name: algo-{{ 999999 | random(seed=lookup('file', SSH_keys.public)) }}
|
||||||
public_key: "{{ lookup('file', SSH_keys.public) }}"
|
public_key: "{{ lookup('file', SSH_keys.public) }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -14,7 +11,7 @@
|
||||||
register: hcloud_ssh_key
|
register: hcloud_ssh_key
|
||||||
|
|
||||||
- name: Create a server...
|
- name: Create a server...
|
||||||
hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ algo_server_name }}"
|
name: "{{ algo_server_name }}"
|
||||||
location: "{{ algo_hcloud_region }}"
|
location: "{{ algo_hcloud_region }}"
|
||||||
server_type: "{{ cloud_providers.hetzner.server_type }}"
|
server_type: "{{ cloud_providers.hetzner.server_type }}"
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
algo_hcloud_token: "{{ hcloud_token | default(_hcloud_token.user_input|default(None)) | default(lookup('env','HCLOUD_TOKEN'), true) }}"
|
algo_hcloud_token: "{{ hcloud_token | default(_hcloud_token.user_input|default(None)) | default(lookup('env','HCLOUD_TOKEN'), true) }}"
|
||||||
|
|
||||||
- name: Get regions
|
- name: Get regions
|
||||||
hcloud_datacenter_facts:
|
hetzner.hcloud.datacenter_info:
|
||||||
api_token: "{{ algo_hcloud_token }}"
|
api_token: "{{ algo_hcloud_token }}"
|
||||||
register: _hcloud_regions
|
register: _hcloud_regions
|
||||||
|
|
||||||
- name: Set facts about the regions
|
- name: Set facts about the regions
|
||||||
set_fact:
|
set_fact:
|
||||||
hcloud_regions: "{{ hcloud_datacenter_facts | sort(attribute='location') }}"
|
hcloud_regions: "{{ _hcloud_regions.hcloud_datacenter_info | sort(attribute='location') }}"
|
||||||
|
|
||||||
- name: Set default region
|
- name: Set default region
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
---
|
|
||||||
- name: Install requirements
|
|
||||||
pip:
|
|
||||||
name:
|
|
||||||
- hcloud
|
|
||||||
state: latest
|
|
||||||
virtualenv_python: python3
|
|
Loading…
Add table
Reference in a new issue