Inventory and automation of NeonTech infrastructure using Ansible. Ansible's sample alternative directory layout is adhered to for this repository.
Skip this section if running playbooks on NeonTech infrastructure.
Otherwise, significant changes to this repository are required to have playbooks function as intended. The following list is currently not exhaustive (contributions welcome!):
-
Create a password and store it securely. It is recommended to use a trusted password manager and/or ferroelectric USB. This will be needed to encrypt files using
ansible-vault. -
Find and replace every instance of
neontech.devwith a new domain. -
Remove all content from
known_hosts, but do not delete the file. -
Replace all SSH public/private keys for every host in
ssh. SSH public/private keys can be generated by executing the following:ssh-keygen -t ed25519 -a 100 -C "ansible" -N '' -q -f ./ssh/<environment>/<host>_<user>_ed25519. Remember to encrypt the private keys usingansible-vault. -
Replace the public certificates in
roles/step_ca/files/certs. Step CA can be initialized locally to generate valid certificates.a. Replace
ca_fingerprintininventories/<environment>/group_vars/all/ca.yml. -
Delete all encrypted variable files in
inventoriesby searching for$ANSIBLE_VAULT;1.1;AES256. Recreate the variable files by using knownvault_variables used in their respective, non-encrypted, file. Remember to encrypt the recreated files usingansible-vault. -
Edit all unencrypted variable files as needed. Refer to
roles/<role>/defaultsfor available variables.
It is also important to keep in mind this repository is currently in active development. There are gaps in the automation as indicated by TODO comments and breaking changes may occur spontansiously without warning. USE AT YOUR OWN RISK!
-
Clone the repository:
git clone https://github.com/NeonTech/ansible.git -
Set the working directory as the root of the repository:
cd ansible -
Initialize the repository:
scripts/initialize.sh -
Test connections to hosts:
ansible all --inventory inventories/<environment>/hosts --vault-password-file vault-password-file --module-name ansible.builtin.ping -
Run the
site.ymlplaybook to deploy everything:ansible-playbook site.yml --inventory inventories/<environment>/hosts --vault-password-file vault-password-file