Terraform must be installed before this can be run. Installation Instruction: https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
Ansible must be installed as well. Installation Instructions: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
This operates assuming the ssh key "River" is being used and that a project named "4640_labs" was created.
- This assumes the key is found in the directories "/dev/River" and "/mgmt/River"
- If the project on digital ocean is named differently change line 25 of "/dev/main.tf" to "name = """
- go to line 19 of "/dev/main.tf" change "name = "River"" to "name = "
- Make sure that "/mgmt/inventory/group_vars/all" has line 3 "ansible_ssh_private_key_file: River" changed as well
- create a file containing " export DO_API_TOKEN=< INSERT API KEY HERE >" and source it
This should create and run 2 droplets tagged "Web" within the same VPC running rocky linux.
- run terraform init
- run terraform apply once all the above is completed
- It will ask for an API key from digital ocean
- Once entered it will create the required VM
This should install nginx on the digital ocean droplets tagged "Web" and run the nginx service
- ensure digitalocean plugin is installed with "ansible-galaxy collection install community.digitalocean"
- once that is confirmed and the api token is set with the DO_API_TOKEN you can then run "ansible-playbook nginx_setup.yml -u root"
