Step i: Install amazon.aws collection, Boto
connect to your awx server using mobaxterm and enter
pip3 install boto3
ansible-galaxy collection install amazon.aws
Step ii: Specify your collection path in the ansible config file
vi /etc/ansible/ansible.cfg
Insert the below line
collections_paths = /home/ubuntu/.ansible/collections/ansible_collections
Save
Step ii. Go to your AWS account...
Click on IAM
Go to Users
Click Add UsersCreate a New User , u can call it Tower
Attach Existing Policy
Give it AdministratorAccess and create user
Download ur keys
Step A: Create a New branch myfirstrepo Repository in bitbucket
Name the branch : Ansible
Step B: Open git bash in your project folder and do a git pull to get the latest branch update
cd myfirstrepo
git pullgit checkout Ansible
This will switch to the newly created Ansible branch
Launch Vscode by entering code .
Step C: Playbook to create EC2 instance
Create a new file in Vscode called aws.yml
Paste the below code in the file:
Step 1: First create an Organization: Devops
Description: All Devops Projects
Save
Step 2: Create Credentials for SCM:
Click Credentials ....Click the +
Choose SCM Type: Git
Enter SCM http url
Select the SCM credentials you created
Enter Branch: Ansible
Check UPDATE REVISION ON LAUNCH
Save



















No comments:
Post a Comment