first commit

This commit is contained in:
2026-02-16 17:41:03 +00:00
commit 3f15490a0d
1055 changed files with 194272 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
---
- name: Create SSH key in Hetzner
hetzner.hcloud.hcloud_ssh_key:
api_token: "{{ hcloud_token }}"
name: ansible-key
public_key: "{{ hcloud_ssh_public_key }}"
state: present
register: ssh_key_result
- name: Create Hetzner Cloud Server
hetzner.hcloud.hcloud_server:
api_token: "{{ hcloud_token }}"
name: "{{ server_name }}"
server_type: "{{ hcloud_server_type }}"
image: "{{ hcloud_image }}"
location: "{{ hcloud_location }}"
ssh_keys:
- ansible-key
firewalls: "{{ hcloud_firewalls }}"
state: present
register: created_server
- name: Show public IPv4
ansible.builtin.debug:
var: created_server.hcloud_server.ipv4_address
- name: Add new server to inventory
add_host:
name: newserver
ansible_host: "{{ created_server.hcloud_server.ipv4_address }}"
ansible_user: root
ansible_ssh_private_key_file: "~/.ssh/id_ed25519"