Repository for the task.
Connection SSH:
- Inside the directory .ssh I have created a file with clave named clave.pem
- Permissions: chmod 400 clave.pem
- Connection: ssh [email protected] -i clave.pem


Creating a new connection:
- ssh-keygen -t rsa -b 4096 -C "[email protected]"
- Copy the contain of: cat id_rsa.pub
- Put the new key in GitHub.
Ansible:
- Install Ansible with: sudo apt-get install ansible
- Creating host, ansible.cfg and playbook.yml files.
- Provisioning with: ansible-playbook playbook.yml

Docker:
- Install docker in the aws machine using: sudo apt-get intsall docker.io
- I created an automatic build from DockerHub using my Dockerfile which is in my GitHub repository named debian-nginx.
- Then I did docker pull stiago/debian-nginx
- sudo service docker start
- sudo docker run -it stiago/debian-nginx bash


Finally we have our container:

If I would have had more time I could do the orchestation with Vagrant using the vagrantfile and with this I could provision and do the container with Ansible and Docker.
Using aws credential:
export AWS_KEY=[AccessKey]
export AWS_SECRET=[SecretKey]
export AWS_SECURITY_GROUP_NAME=[SGName]
export AWS_KEYNAME=[keyPairName]
export AWS_KEY_PATH=[Path to your private key]
- Install: vagrant plugin instal vagrant-aws
- vagrant box add dummy https://......
- vagrant up --provider=aws
- vagrant ssh
This software has GNU GPL v3 license.
Content type
Image
Digest
Size
68.3 MB
Last updated
over 9 years ago
docker pull stiago/debian-nginx