Init docker containers as remote hosts
-
Start docker containers, they will be used as remote hosts
sudo docker-compose up -d
-
Check ssh connection (optional, password - ansible)
ssh root@localhost -p 5020
-
Copy local ssh keys to containers
ssh-copy-id -i ~/.ssh/id_rsa.pub root@localhost -p 5020
ssh-copy-id -i ~/.ssh/id_rsa.pub root@localhost -p 5021
-
Install python in containers (optional, if needed)
ansible -i my-inventory.ini all -m raw -a "apt-get install -y python"
-
Ping hosts
ansible -i my-inventory.ini docker -m ping
Mongodb
ansible-playbook -i my-inventory.ini mongodb/site.yaml
TODO
- Install latest mongodb version
- Set mongodb cluster