Skip to content

Commit

Permalink
Provide a test inventory file
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Dec 18, 2024
1 parent fa5d459 commit e3cc964
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ RUN mc --version
WORKDIR /ansible

# Copy Ansible files
COPY inventory.ini ansible.cfg ./
COPY ansible.cfg ./
COPY roles ./roles
COPY playbooks ./playbooks

# This directory should be mounted by the user
COPY tests/inventory.ini /config/inventory.ini

# Run playbook
ENTRYPOINT ["ansible-playbook", "playbooks/main.yml"]
7 changes: 3 additions & 4 deletions ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ remote_tmp = /tmp/ansible
local_tmp = /tmp/ansible

# Core ansible files (built into image)
inventory = /ansible/inventory
roles_path = /ansible/roles
collections_path = /ansible/collections

# User-provided files (mounted at runtime)
# inventory = /config/inventory
host_vars_path = /config/host_vars
group_vars_path = /config/group_vars
inventory = /config/inventory.ini
# host_vars_path = /config/host_vars
# group_vars_path = /config/group_vars
2 changes: 1 addition & 1 deletion docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
set -ex
ansible-playbook playbooks/main.yml
for config in $(ls /config/extra_vars/*.yml); do
ansible-playbook playbooks/main.yml --extra-vars "@$${config}" --inventory /config/inventory.ini
ansible-playbook playbooks/main.yml --extra-vars "@$${config}"
done
volumes:
Expand Down
2 changes: 0 additions & 2 deletions inventory.ini

This file was deleted.

0 comments on commit e3cc964

Please sign in to comment.