msoc-infrastructure/packer
(suggestion: keep an ISOs directory and make a symbolic link into the packer directory)http/ks.local.cfg
and update with your username and passwordmake base-local
to create a local iso.msoc-infrastructure/packer/output-virtualbox-iso
, select packer-centos-7-local-x86_64.ova
salt-master.vmdk
or somethimg memorableInstall guest additions:
sudo yum update && sudo yum upgrade
sudo yum groupinstall "Development Tools"
sudo yum install vim kernel-devel
sudo yum --enablerepo=epel install dkms
sudo mount /root/VBoxGuestAdditions.iso /mnt
cd /mnt
sudo ./VBoxLinuxAdditions.run
Add the shared folder mount point mkdir ~/msoc-infrastructure
Add this to /etc/fstab
:
msoc-infrastructure /home/fdamstra/msoc-infrastructure vboxsf uid=fdamstra,gid=fdamstra 0 0
Reboot
Run the scripts in rhel7_hardened_saltmaster_ami.json
:
cd msoc-infrastructure/packer/
# Skipping add-rhel-subscription, cuz centos
sudo scripts/add-saltstack-repo.sh
# Skipping add-epel-repo, because how many times do we need to do this?
sudo scripts/provision-salt-minion.sh
# Have to do the "internal-configure-minion.sh" stuff ourselves, becuase
# we don't match.
sudo echo "master: salt-master.home.monkeybox.org" | tee /etc/salt/minion
sudo scripts/provision-salt-master.sh
# Skipping scripts/install-ssm-agent.sh because not in aws
# Skipping scripts/cloud-init-resize-fs.sh becase not in aws
# Skipping scripts/remove-machine-id.sh because not bulding more than one
# Skipping scripts/remove-rhel-subscription.sh because not building more than one
Reboot
Run the cloud init script:
cd msoc-infrastructure/terraform/02-msoc_vpc/cloud-init/
sudo bash provision_salt_master.sh
Errors about secrets are expected. Lots of amazon stuff just won't work.
remove /etc/salt/pki/master/master.{pem,pub}
fix the minion id: echo salt-master.home.monkeybox.org > /etc/salt/minion_id
start salt-master service
start salt-minion service
Accept the key: sudo salt-key -A
Create /etc/salt/master.d/file_roots.conf:
file_roots:
base:
# Used by the maxmind stuff, not in gitfs because we download
# this file by script every so often
- /var/opt/salt
Link to the file root (we don't use gitfs here):
ln -s /home/fdamstra/msoc-infrastructure/salt/fileroots /var/opt/salt