diff --git a/README.md b/README.md index 0a20b96..0754867 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # Ansible -Docker image with [ansible-core](https://docs.ansible.com/ansible-core/devel/index.html) installed. +Docker image with [ansible-core](https://docs.ansible.com/ansible-core/devel/index.html) installed. It can be used as base image for containers providing Ansible automations. + +Docker Hub: [fabos4ai/ansible-core](https://hub.docker.com/repository/docker/fabos4ai/ansible-core) + +An example can be found in the `example` directory: + +``` +docker build -t ansible-example . +docker run ansible-example +``` diff --git a/example/Dockerfile b/example/Dockerfile new file mode 100644 index 0000000..d4be513 --- /dev/null +++ b/example/Dockerfile @@ -0,0 +1,7 @@ +FROM fabos4ai/ansible-core:2.11.9 + +COPY src /src + +WORKDIR src + +CMD ansible-playbook main.yml diff --git a/example/src/main.yml b/example/src/main.yml new file mode 100644 index 0000000..e81c3dc --- /dev/null +++ b/example/src/main.yml @@ -0,0 +1,6 @@ +- name: "Example" + hosts: localhost + gather_facts: yes + tasks: + - debug: + msg: "Simple Ansible automation running inside a container"