If you want to start playing with Ansible and don't want to create several VM's or don't have physical hosts, this is a good place to start.
Using docker you can create a private network for your virtual hosts and play with Ansible.
Eclipse Che allows you to interact with those virtual hosts in an integrated and "natural" environment.
Let's start!.
- Login into Eclipse Che console.
- Select "Stacks" and click "Build Stack From Recipe".
- In Compose Tab paste the content of docker-compose.yml file and click "OK".
- Set name and description for the new stack.
- Enable Exec, Terminal and Workspace API to "ANSIBLE" machine.
- For S's machines enable just Terminal.
- Click "Save".
Now you have a new Stack with four machines: one with ansible and three "servers". Let's create a new workspace with that stack and start playing wth ansible.
- Go to workspaces section in Eclipse Che.
- Click "Add Workspace".
- Set the name for the new workspace.
- Select the stack created before.
- Click "Create".
And we are done!.
From ansible machine run the following command:
ssh-keygen -t rsa
Again, from ansible machine run ssh-copy-id hostname
for every server (s1, s2 and s3).
ansible all -m apt -a "name=iputils-ping state=present"
ansible-playbook example.yml
All files used to build Docker images, create Eclipse Che Stacks and configure Ansible hosts are available and you are free to modify them as you want.