Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sébastien Luttringer
infrastructure
Commits
0d4e1425
Commit
0d4e1425
authored
Mar 24, 2019
by
Sven-Hendrik Haase
Browse files
Allow ansible to use the hcloud token
parent
a5b7c2fc
Changes
5
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
0d4e1425
...
...
@@ -11,8 +11,8 @@ run the provisioning script: `ansible-playbook playbooks/tasks/install-arch.yml
The provisioning script configures a sane basic systemd with sshd. By design, it is NOT idempotent.
After the provisioning script has run, it is safe to reboot.
Once in the new system, run the regular playbook:
`ansible-playbook playbooks/$hostname.yml`
.
This
playbook is the one regularity used for administrating the server and is entirely idempotent.
Once in the new system, run the regular playbook:
`
HCLOUD_TOKEN=$(misc/get_hcloud_api_key_ansible.sh)
ansible-playbook playbooks/$hostname.yml`
.
This
playbook is the one regularity used for administrating the server and is entirely idempotent.
##### Note about first time certificates
...
...
@@ -29,7 +29,7 @@ Note that some roles already run this automatically.
We use packer to build snapshots on hcloud to use as server base images.
In order to use this, you need to install packer and then run
packer build -var $(./
packer/get_hetzner_
cloud_api_key.sh) packer/archlinux.json
packer build -var $(./
misc/get_h
cloud_api_key
_packer
.sh) packer/archlinux.json
This will take some time after which a new snapshot will have been created on the primary hcloud archlinux project.
...
...
@@ -38,12 +38,12 @@ This will take some time after which a new snapshot will have been created on th
We use terraform to provision a part of the infrastructure on hcloud.
In order to use this, you need to install terraform and then run
terraform plan -var $(./
packer/get_hetzner_
cloud_api_key.sh) terraform
terraform plan -var $(./
misc/get_h
cloud_api_key
_packer
.sh) terraform
This will show you planned changes between the current infrastructure and the desired infrastructure.
You can then run
terraform apply -var $(./packer/get_h
etzner_
cloud_api_key.sh) terraform
terraform apply -var $(./packer/get_hcloud_api_key
_packer
.sh) terraform
to actually apply your changes.
...
...
ansible.cfg
View file @
0d4e1425
[defaults]
inventory = hosts,hcloud.yml
inventory = hosts,
inventory_
hcloud.yml
library = library
remote_tmp = $HOME/.ansible/tmp
remote_user = root
...
...
hcloud.yml
→
inventory_
hcloud.yml
View file @
0d4e1425
File moved
misc/get_hcloud_api_key_ansible.sh
0 → 100755
View file @
0d4e1425
#!/bin/bash
ansible-vault view misc/hetzner-password.vault |
grep
hetzner_cloud_api_key |
cut
-f2
-d
' '
packer/get_hetzner_
cloud_api_key.sh
→
misc/get_h
cloud_api_key
_packer
.sh
View file @
0d4e1425
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment