First, you need a linux machine, install these applications:
- Python Pip
- Boto - AWS Command Line Interface
- Jenkins
- Ansible
- Docker
Then, execute these commands:
- Enter your AWS credentials: aws configure
- Add your AWS pem file, and execute: chmod 400 *.pem
- Make jenkins user admin: visudo => jenkins ALL=(ALL) NOPASSWD: ALL (add bottom line)
- Add jenkins user to docker group: usermod -aG docker jenkins
- Add ec2.py as an ansible hosts file, and ec2.ini to the same directory with hosts file
- Add: host_key_checking=false to the defaults section in ansible.cfg
- For temp docker image, create a directory and give jenkins user to write permisson: chown -R jenkins folder_path