code/environments/production/modules/role/manifests
Just copy the old one because we're lazy. We can always add/remove profile manifests from the role later if needed.
cp iac_node.pp franklin_node.pp
Edit the file: code/environments/production/modules/profile/lib/facter
Add a "when" clause for the new node, something like this:
# <ENVIRONMENTS DIRECTORY>/<ENVIRONMENT>/modules/profile/lib/facter/role.rb
Facter.add(:role) do
# Retrieve hostname and assign role base on it
setcode do
hname = Facter.value(:hostname)
case hname
when /^airlock/
'airlock'
when /^franklin_node/
'franklin_node'
else
'iac_node'
end
end
end
Edit the hostname to match the new "when" statement and this role should be applied to it.
So basically add a new host in iac_workshop/terraform/aws/machines.tf.
Run the terraform.
Log in to the host ane run this command. Verify the role is correct.
puppet facts show | grep role