Skip to content

ojooss/ansible-via-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#ansible-via-docker

build image

docker build --tag bsmart/ansible-via-docker:latest .

use image

first we test our installation

docker run --rm bsmart/ansible-via-docker:latest ansible --version

before running playbooks, we have to copy our key

docker run --rm bsmart/ansible-via-docker:latest ssh-copy-id -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa.pub [email protected]

and finally we can run plays.

Therefore we use the workdir as a host volume. And we disable ANSIBLE_HOST_KEY_CHECKING, otherwise connection will be blocked by default

docker run --rm -v ${PWD}/workdir:/ansible -e ANSIBLE_HOST_KEY_CHECKING=False bsmart/ansible-via-docker:latest ansible-playbook -i inventory.ini helloworld.yaml

finally run ansible playbook

Just run docker-compose like this

docker-compose run ansible

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published