Skip to content

Commit

Permalink
tweaked userdata
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticaltech committed Mar 2, 2022
2 parents c5c8004 + cd07025 commit fa63558
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions modules/host/templates/userdata.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#cloud-config

# Resize /var, not /, as that's the last partition in MicroOS image.
growpart:
devices: ["/var"]

write_files:
# Configure private network
- content: |
Expand Down Expand Up @@ -28,13 +32,16 @@ write_files:
- ${key}
%{ endfor ~}

# Making sure the hostname is set correctly
# Make sure the hostname is set correctly
manage_etc_hosts: "localhost"
preserve_hostname: true
prefer_fqdn_over_hostname: false
hostname: ${hostname}

runcmd:
# As above, make sure the hostname is not reset
- sed -i 's#NETCONFIG_NIS_SETDOMAINNAME="yes"#NETCONFIG_NIS_SETDOMAINNAME="no"#g' /etc/sysconfig/network/config

# Activate the private network
- systemctl reload network

Expand All @@ -48,4 +55,3 @@ runcmd:
# And from 4-10 number limit important, to 2
- snapper -c root set-config "NUMBER_LIMIT=4"
- snapper -c root set-config "NUMBER_LIMIT_IMPORTANT=2"

8 changes: 7 additions & 1 deletion terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# You need to replace these
# Values in this file serve as an example only,
# you are expected to adapt them to your needs.
#
# Some of them, notably "location" and "public_key" have no effect after the initial cluster has been setup.
# This is in order to keep terraform from re-provsioning all nodes at once which would loose data. You should
# instead change the value here and then manually re-provsion each node one-by-one. Grep for "lifecycle".

hcloud_token = "xxxxxxxxxxxxxxxxxxYYYYYYYYYYYYYYYYYYYzzzzzzzzzzzzzzzzzzzzz"
public_key = "/home/username/.ssh/id_ed25519.pub"
# Must be "private_key = null" when you want to use ssh-agent, for a Yubikey like device auth or an SSH key-pair with passphrase
Expand Down

0 comments on commit fa63558

Please sign in to comment.