From b84b4a514c69c8781faf90349d9e27b58dcdd49c Mon Sep 17 00:00:00 2001 From: Dov Benyomin Sohacheski Date: Wed, 17 Jul 2024 15:11:59 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=83=20Add=20readme=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- README.md | 26 +++++++++++++++++++++++++- src/requirements.txt | 2 +- src/requirements.yaml | 4 ++-- src/rootfs/etc/ansible/hosts | 4 ++-- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 649cae2..8f0a493 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,7 +58,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG TARGETARCH # renovate: source=github-releases dep=google/go-containerregistry -ARG crane_version=0.20.0 +ARG crane_version=0.20.1 RUN case ${TARGETARCH} in "arm64") amr64 ;; "amd64") file=x86_64 ;; esac \ && curl -fsSL "https://github.com/google/go-containerregistry/releases/download/v${crane_version}/go-containerregistry_Linux_${file}.tar.gz" \ diff --git a/README.md b/README.md index f03b7cd..155a71f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,31 @@ ## Documentation -TBD +The image includes a default inventory *(`/etc/ansible/hosts`)* named `controller` that +runs on `localhost` without root privileges. + +To use it, copy the following example playbook: + +```yaml +- name: Run something + gather_facts: false + hosts: controller + + tasks: + - name: Just saying hello + ansible.builtin.debug: + msg: Hello world! 👋 +``` + +### Run + +```sh +docker run --rm \ + -v ./playbooks:/workspace \ + ghcr.io/kloudkit/ansible-controller \ + -e FOO=bar \ + /workspace/play.yaml +``` ## License diff --git a/src/requirements.txt b/src/requirements.txt index 85e46f7..20f609f 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,4 +1,4 @@ -ansible-core==2.17.1 +ansible-core==2.17.2 docker==7.1.0 kubernetes==30.1.0 netaddr==1.3.0 diff --git a/src/requirements.yaml b/src/requirements.yaml index 61d7bea..cd2f568 100644 --- a/src/requirements.yaml +++ b/src/requirements.yaml @@ -4,10 +4,10 @@ collections: version: 1.5.4 - name: community.crypto - version: 2.20.0 + version: 2.21.0 - name: community.general - version: 9.1.0 + version: 9.2.0 - name: kubernetes.core version: 5.0.0 diff --git a/src/rootfs/etc/ansible/hosts b/src/rootfs/etc/ansible/hosts index a9976c7..3920f5e 100644 --- a/src/rootfs/etc/ansible/hosts +++ b/src/rootfs/etc/ansible/hosts @@ -1,7 +1,7 @@ --- -workspace: +controller: hosts: localhost: vars: ansible_connection: local - ansible_become: true + ansible_become: false