Skip to content

Commit

Permalink
Remove generate_terraform_self.rb calls
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Feb 27, 2024
1 parent a0ba967 commit ac833e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion common/configuration/puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ runcmd:
- "(cd /etc/puppetlabs/code/environments/production; /opt/puppetlabs/puppet/bin/r10k puppetfile install)"
# Wait for Terraform to scp its YAML data
- while [ ! -e "/etc/puppetlabs/data/terraform_data.yaml" ]; do echo "$(date -I'seconds') Waiting for terraform to scp terraform_data.yaml"; sleep 5; done
- /etc/puppetlabs/code/environments/production/scripts/generate_terraform_self.rb
%{ if node_name != keys(puppetservers)[0] }
- sed -e '/certificate-authority-service/ s/^/#/' -i /etc/puppetlabs/puppetserver/services.d/ca.cfg
- sed -e '/certificate-authority-disabled-service/ s/^#//' -i /etc/puppetlabs/puppetserver/services.d/ca.cfg
Expand Down
8 changes: 6 additions & 2 deletions common/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ output "domain" {
output "accounts" {
value = {
guests = {
usernames = var.nb_users != 0 ? (
"user[${format(format("%%0%dd", length(tostring(var.nb_users))), 1)}-${var.nb_users}]"
usernames = var.nb_users > 0 ? (
var.nb_users > 1 ? (
"user[${format(format("%%0%dd", length(tostring(var.nb_users))), 1)}-${var.nb_users}]"
) : (
"user"
)
) : (
"You have chosen to create user accounts yourself (`nb_users = 0`), please read the documentation on how to manage this at https://github.com/ComputeCanada/magic_castle/blob/main/docs/README.md#103-add-a-user-account"
),
Expand Down
1 change: 0 additions & 1 deletion common/provision/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ resource "terraform_data" "deploy_hieradata" {
"sudo install -o root -g 52 -m 640 terraform_data.yaml user_data.yaml /etc/puppetlabs/data/",
"sudo install -o root -g 52 -m 640 terraform_facts.yaml /etc/puppetlabs/facts/",
"rm -f terraform_data.yaml user_data.yaml terraform_facts.yaml",
"[ -f /etc/puppetlabs/code/environments/production/scripts/generate_terraform_self.rb ] && sudo /etc/puppetlabs/code/environments/production/scripts/generate_terraform_self.rb || true",
"[ -f /usr/local/bin/consul ] && [ -f /usr/bin/jq ] && consul event -token=$(sudo jq -r .acl.tokens.agent /etc/consul/config.json) -name=puppet $(date +%s) || true",
]
}
Expand Down

0 comments on commit ac833e6

Please sign in to comment.