Having Docker Installed on your system
Refrence to install Docker > Click here
This is ansible setup script via Docker and containers.
It creates a workstation where we will create and run ansible scripts. and 4 node containers under same network as of workstation namely
NOTE: Default user when nodes starts is user: root
So you have to set root as user for ansible playbook scripts.
NOTE: You have to write directly the below given hostname to your ansible inventory instead of using IP addresses
- workstation
- servera
- serverb
- serverc
- serverd
Clone the repo through git clone https://github.com/Rishang/dockerAnsi.git
and cd dockerAnsi
.
This step has to done only once and may take some time.
make build
make start
Thats it now workstation and node has been started on same network.
Access shell of workstation
make run_workstation
This command will give you shell to the workstation container
The ~/script
folder in workstation is mounted to local storage so create all your ansible scripts in ~/scripts
cd ~/scripts
OK now good to go, create all your ansible scripts in this directory.
you can also access it form local system in folder called my_work
also can write sripts directly there and run it inside workstation container.
If your work in completed and want to shut down all container run following command.
make stop