Used to provision machines or a collection of machines
287
Used to provision machines or a collection of machines
https://hub.docker.com/r/arranbartish/provisioning/
For testing setup an empty VM on 10.0.2.2
config file, like the some below, in the same directory. Ensure that the host, user, and ssh port actually match the target machineHost docker-node
HostName 10.0.2.2
user arran
port 2222
$ docker build -t provisioning .
$ docker run -v ~/.ssh:/ssh -v ~/dev/provisioning/files:/files --env-file .env --name provision provisioning
$ docker exec -u 0 -it <CONTAINER ID> /bin/bash
$ docker run --rm -v ~/.ssh:/ssh --env-file .env provisioning "ansible-playbook files/playbook.yml -i files/hosts && ssh docker-node 'cat hello-world.txt'"
$ docker run --rm -v ~/.ssh:/ssh --env-file .env arranbartish/provisioning "ansible-playbook files/playbook.yml -i files/hosts && ssh docker-node 'cat hello-world.txt'"
The above command will execute using the package "default" inventory and playbook in the image.
You can mount custom inventory and playbooks in a volume and use them from the same image.
$ docker run --rm -v ~/.ssh:/ssh -v ~/dev/provisioning/files:/files --env-file .env arranbartish/provisioning "ansible-playbook /files/playbook.yml -i /files/hosts && ssh docker-node 'cat hello-world.txt'"
Content type
Image
Digest
Size
131.2 MB
Last updated
about 9 years ago
docker pull arranbartish/provisioning