diff --git a/.gitignore b/.gitignore index ce3e6a1..3f45b22 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,5 @@ # Ignore generated passwords file generated_passwords.txt - -# Ignore Vagrant testing files +# Ignore Vagrant directory .vagrant/ -test_ansible.cfg -Vagrantfile -inventory/test_inventory diff --git a/README.md b/README.md new file mode 100644 index 0000000..4177832 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Ansible Rollout Playbooks + +## Plays +- playbooks/setup_base_system.yml - Sets up the base system + - Can generate passwords with the `generate_user_password` variable + - Passwords will be placed in a file called `generated_passwords.txt` +- playbooks/update_systems.yml - Updates the systems +- playbooks/install_tor.yml - Installs Tor for all hosts in the `tor_systems` group + +### Testing Plays +If you would like to test out the plays before using them on your live systems, this +repository includes a Vagrantfile, Ansible test configuration, and a test inventory. + +To test the plays, run the following commands: +```bash +vagrant up +ANSIBLE_CONFIG=test_ansible.cfg ansible-playbook playbooks/setup_base_system.yml -e "generate_user_password=yes" +ANSIBLE_CONFIG=test_ansible.cfg ansible-playbook playbooks/update_systems.yml +ANSIBLE_CONFIG=test_ansible.cfg ansible-playbook playbooks/install_tor.yml +``` + +## Contributors +- [agatha](https://git.juggalol.com/agatha) diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..f9bcd4e --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,13 @@ +Vagrant.configure("2") do |config| + config.vm.box = "debian/bullseye64" + + config.vm.define "testserver1" do |testserver1| + testserver1.vm.hostname = "testserver1" + testserver1.vm.network "private_network", ip: "192.168.56.11" + end + + config.vm.define "testserver2" do |testserver2| + testserver2.vm.hostname = "testserver2" + testserver2.vm.network "private_network", ip: "192.168.56.12" + end +end \ No newline at end of file diff --git a/inventory/test_inventory b/inventory/test_inventory new file mode 100644 index 0000000..cfee3aa --- /dev/null +++ b/inventory/test_inventory @@ -0,0 +1,9 @@ +[all:vars] +ansible_user=vagrant + +[testservers] +testserver1 ansible_host=192.168.56.11 ansible_ssh_private_key_file=.vagrant/machines/testserver1/virtualbox/private_key +testserver2 ansible_host=192.168.56.12 ansible_ssh_private_key_file=.vagrant/machines/testserver2/virtualbox/private_key + +[tor_systems] +testserver1 \ No newline at end of file diff --git a/test_ansible.cfg b/test_ansible.cfg new file mode 100644 index 0000000..5195176 --- /dev/null +++ b/test_ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +inventory = ./inventory/test_inventory +roles_path = ./roles +remote_user = vagrant +host_key_checking = False \ No newline at end of file