Skip to content

Commit

Permalink
📃 Add readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
bdsoha committed Jul 17, 2024
1 parent 260a554 commit b84b4a5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/rootfs/etc/ansible/hosts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
workspace:
controller:
hosts:
localhost:
vars:
ansible_connection: local
ansible_become: true
ansible_become: false

0 comments on commit b84b4a5

Please sign in to comment.