Ansible On Docker

Опубликовано: 24 Октябрь 2024
на канале: technotes of Hemant
3,072
38

This Video tutorial is aiming to extend the docker knowledge gained so far and using it to run ANSIBLE inside DOCKER containers. Here we are discussing some basis docker management commands and Ansible commands as well: A basic step documentation is below:

Automate EVERYTHING with Ansible! (Ansible for Beginners)

ANSIBLE ON DOCKER

1. GitHub Code: https://github.com/HemantGangwar/Ansi...
2. Building Docker images:

docker build -f Dockerfile -t ansible-master .
docker build -f Dockerfile1 -t ansible-slave .
3. Spinning the containers:

docker run -d --privileged --name ansiblemaster ansible-master
docker run -d --privileged --name ansibleslave ansible-client

4. Identifying IP's to connect:

docker inspect ansiblemaster | grep IPAddress
5. Connecting to docker instance:

docker exec -it ansiblemaster /bin/bash

You can also test our pre-generated docker images for your testing as well

[root@dnode1 AnsibleOnDocker]# docker search hgangwar | grep -i /ansible
hgangwar/ansible-centos-client Ansible managed host 0
hgangwar/ansible-centos-master Ansible master 0
[root@dnode1 AnsibleOnDocker]#