This repository will contain sample for creaing devops user and copy ssh keys to remote ec2 servers
-
configs - contain environment specific variable
-
inventories - contains inventory file for each environment
-
groups_vars - contains common variables across environments
-
roles - This will have subfolders like java,tomcat
a) add_devops_user - This folder will have files related to the setup of initial user
-
main.yml - This is the main file which will execute roles in the playbook
ansible-playbook main.yml -i inventories/dev/hosts --user ec2-user --key-file /home/ec2-user/playbooks/ansible_auth.pem -e '@configs/dev.yml'
ansible-playbook main.yml -i inventories/dev/hosts --user devops --key-file /home/devops/.ssh/id_rsa -e '@configs/dev.yml'