initial commit

This commit is contained in:
Thomas von Dein 2024-11-06 19:51:04 +01:00
commit a5ab199dc8
7 changed files with 49 additions and 0 deletions

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
.PHONY: all deploy check
deploy:
ansible-playbook -vvv --ask-vault-pass server-role.yaml -i inventory
check:
ansible-playbook -vvv --ask-vault-pass server-role.yaml -i inventory --syntax-check

2
group_vars/all Normal file
View File

@ -0,0 +1,2 @@
type: cpx11
image: 191285714

1
host_vars/mx.yaml Normal file
View File

@ -0,0 +1 @@
hostname: mx

1
host_vars/shell.yaml Normal file
View File

@ -0,0 +1 @@
hostname: shell

4
inventory/all.yaml Normal file
View File

@ -0,0 +1,4 @@
shellservers:
hosts:
shell:
mx:

View File

@ -0,0 +1,11 @@
---
- name: Create server
hcloud_server:
api_token: "{{ hcloud_token }}"
name: "{{ hostname }}"
server_type: "{{ type }}"
image: "{{ image }}"
location: ash
enable_ipv4: false
state: present
register: server

23
server-role.yaml Normal file
View File

@ -0,0 +1,23 @@
---
- name: Create BSDNIX Servers
hosts: all
connection: local
gather_facts: False
user: root
vars:
# generated with:
# echo -n $(hcloud config get token --allow-sensitive) \
# | ansible-vault encrypt_string --stdin-name hcloud_token
hcloud_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
64393765623232326566303864653934396432613235626330326335383332623437396163336432
3035386161376333386334653863323933393366636537300a666338373539633566336230353362
66653331663364346137383637666332333565373138646533313339323034353833383832336261
3665656264356165300a636633366166363261663663336664653832646666313936396665356132
37373235623735633266353963666364363461303939343532636131643164333930343434336366
36346235336561386237323931333435343461336239323435356634333439303765313663656231
65313964306535376236613635346363376235363330303962353365383537616139393965646563
37356465653663373362
roles:
- role: server