-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(terraform): better cloud-init, hostname setup (#549)
- Loading branch information
1 parent
c5aec2c
commit 77cefc9
Showing
23 changed files
with
413 additions
and
140 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#cloud-config | ||
users: | ||
- name: freecodecamp | ||
groups: sudo | ||
shell: /bin/bash | ||
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | ||
ssh_import_id: | ||
- gh:camperbot | ||
- raisedadead | ||
runcmd: | ||
- usermod -aG docker freecodecamp | ||
# Configure sshd | ||
- | | ||
sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PubkeyAuthentication/s/^.*$/PubkeyAuthentication yes/' /etc/ssh/sshd_config | ||
sed -i -e '$aAllowUsers freecodecamp' /etc/ssh/sshd_config | ||
# Configure hostname | ||
- | | ||
sed -i '/preserve_hostname: false/c\preserve_hostname: true' /etc/cloud/cloud.cfg | ||
hostnamectl set-hostname ${tf_hostname} | ||
echo \"${tf_hostname}\" > /etc/hostname | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
# | ||
# This next line should be the last command in the list, | ||
# because it involves restarting the ssh service. | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
- systemctl restart sshd | ||
final_message: 'Setup complete' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#cloud-config | ||
users: | ||
- name: freecodecamp | ||
groups: sudo | ||
shell: /bin/bash | ||
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | ||
ssh_import_id: | ||
- gh:camperbot | ||
- raisedadead | ||
runcmd: | ||
- usermod -aG docker freecodecamp | ||
# Configure sshd | ||
- | | ||
sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PubkeyAuthentication/s/^.*$/PubkeyAuthentication yes/' /etc/ssh/sshd_config | ||
sed -i -e '$aAllowUsers freecodecamp' /etc/ssh/sshd_config | ||
# Configure hostname | ||
- | | ||
sed -i '/preserve_hostname: false/c\preserve_hostname: true' /etc/cloud/cloud.cfg | ||
hostnamectl set-hostname ${tf_hostname} | ||
echo \"${tf_hostname}\" > /etc/hostname | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
# | ||
# This next line should be the last command in the list, | ||
# because it involves restarting the ssh service. | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
- systemctl restart sshd | ||
final_message: 'Setup complete' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
terraform/prd-cluster-publish/cloud-init--userdata.yml.tftpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#cloud-config | ||
users: | ||
- name: freecodecamp | ||
groups: sudo | ||
shell: /bin/bash | ||
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | ||
ssh_import_id: | ||
- gh:camperbot | ||
- raisedadead | ||
runcmd: | ||
- usermod -aG docker freecodecamp | ||
# Configure sshd | ||
- | | ||
sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PubkeyAuthentication/s/^.*$/PubkeyAuthentication yes/' /etc/ssh/sshd_config | ||
sed -i -e '$aAllowUsers freecodecamp' /etc/ssh/sshd_config | ||
# Configure hostname | ||
- | | ||
sed -i '/preserve_hostname: false/c\preserve_hostname: true' /etc/cloud/cloud.cfg | ||
hostnamectl set-hostname ${tf_hostname} | ||
echo \"${tf_hostname}\" > /etc/hostname | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
# | ||
# This next line should be the last command in the list, | ||
# because it involves restarting the ssh service. | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
- systemctl restart sshd | ||
final_message: 'Setup complete' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
terraform/stg-cluster-oldeworld/cloud-init--userdata.yml.tftpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#cloud-config | ||
users: | ||
- name: freecodecamp | ||
groups: sudo | ||
shell: /bin/bash | ||
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | ||
ssh_import_id: | ||
- gh:camperbot | ||
- raisedadead | ||
runcmd: | ||
- usermod -aG docker freecodecamp | ||
# Configure sshd | ||
- | | ||
sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config | ||
sed -i -e '/^PubkeyAuthentication/s/^.*$/PubkeyAuthentication yes/' /etc/ssh/sshd_config | ||
sed -i -e '$aAllowUsers freecodecamp' /etc/ssh/sshd_config | ||
# Configure hostname | ||
- | | ||
sed -i '/preserve_hostname: false/c\preserve_hostname: true' /etc/cloud/cloud.cfg | ||
hostnamectl set-hostname ${tf_hostname} | ||
echo \"${tf_hostname}\" > /etc/hostname | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
# | ||
# This next line should be the last command in the list, | ||
# because it involves restarting the ssh service. | ||
# | ||
# :-----------------------: WARNING :-----------------------: | ||
- systemctl restart sshd | ||
final_message: 'Setup complete' |
Oops, something went wrong.