012.txt - gopherhole - My gopherhole source code.
(HTM) git clone git://jay.scot/gopherhole
(DIR) Log
(DIR) Files
(DIR) Refs
---
012.txt (1990B)
---
1 [jay.scot]
2 [012]
3
4
5 --[ Automating my infra deployment and configuration
6
7
8 Another item on the TODO list was completed yesterday, moving all my
9 hand rolled infrastructure to Terraform and Ansible. I provisioned it
10 all and moved the DNS over to the new setup last night. I forgot to
11 update the DNS TTL and it was really high - DOH! Once the DNS has fully
12 propagated, I can shut down the old servers.
13
14
15 TERRAFORM
16 ---------
17
18 I host all my server at Hetzner Cloud and luckily there is a provider
19 for Terraform. I managed to knock up scripts that provisions the
20 following for me in Hetzner:
21
22
23 add my public ssh key to account and attach to servers.
24 create full customizable firewall per server.
25 create X amount of servers, fully customizable.
26 create reverse dns names for each server.
27 bootstrap with cloud-init, creates and Ansible user with my key.
28
29
30 I was going to use cloud-init to configure the servers at boot but, that
31 would have been nightmare material. Overall, I am happy with the
32 Terraform scripts and won't have the need to refactor or change them
33 much.
34
35
36 ANSIBLE
37 -------
38
39 I really can't be bothered with Ansible these days if truth be told,
40 I have been using it for around 8 years now. So this part of the
41 configuration was kinda rushed, I will need to revisit the code at some
42 point. I never used standard tooling such as molecule etc. and it will
43 only work for Debian based systems. Anyway, this is what the Ansible
44 playbooks do for me.
45
46
47 common tasks - users, add packages, lock down ssh.
48 geomyidae - build from source, setup with systemd.
49 stagit-gopher - build from source, script to run via cron.
50 git - setup hosting with daemon running.
51 efingerd - install and add custom configuration.
52
53
54 I have thrown everything up on git if anyone wants the Terraform or
55 Ansible scripts. You can get them via a git clone or view them over
56 gopher with the following links.
57
58
59 0. git clone git://jay.scot/infra.git
60 1. gopher://jay.scot/1/git/infra/
61
62
63 .EOF