Browse Source

add hcloud

main
Markus Bergholz 7 months ago
parent
commit
4e29d6f77a
1 changed files with 26 additions and 0 deletions
  1. +26
    -0
      hcloud.yml

+ 26
- 0
hcloud.yml View File

@ -0,0 +1,26 @@
---
- hosts: localhost
connection: local
gather_facts: no
vars:
HCLOUD_TOKEN: "{{ lookup('env', 'HCLOUD_TOKEN') }}"
collections:
- hetzner.hcloud
tasks:
- name: create a server that ansible-pulls this repo
hcloud_server:
api_token: "{{ HCLOUD_TOKEN }}"
name: my-server
server_type: cx11
image: ubuntu-20.04
location: fsn1
state: present
user_data: |
#!/bin/bash
apt update
apt install git ansible -y
ln -s /usr/bin/python3 /usr/bin/python
ansible-pull -U https://git.osuv.de/m/server -i inventories/local.ini localhost.yml --extra-vars='{"USER": "user", "PASSWORD": "password"}'

Loading…
Cancel
Save