Generic inventory and playbook

This patch introduces the capacity for the tripleo_entrypoint.sh
script to generate an inventory and/or a playbook from env
variables passed to the runner container by the operator itself

The ansibleee-operator will take care of filling the contents of the
env variables in [1] and [2]

[1] https://github.com/openstack-k8s-operators/ansibleee-operator/pull/20
[2] https://github.com/openstack-k8s-operators/ansibleee-operator/pull/9

Change-Id: I030518bb8807aad9fb0d480a130d327522de707d
This commit is contained in:
jlarriba 2022-11-25 14:55:30 +01:00
parent f0e7da7b0a
commit 7f8a19eb15
2 changed files with 10 additions and 0 deletions

View File

@ -4,4 +4,13 @@
# Expand the variables
eval "echo \"$(cat /runner/env/settings)\"" > /runner/env/settings
if [ -n "$RUNNER_INVENTORY" ]; then
echo "---" > /runner/inventory/inventory.yaml
echo "$RUNNER_INVENTORY" >> /runner/inventory/inventory.yaml
fi
if [ -n "$RUNNER_PLAYBOOK" ]; then
echo "---" > /runner/project/playbook.yaml
echo "$RUNNER_PLAYBOOK" >> /runner/project/playbook.yaml
# Contents from ansible-runner entrypoint

View File

@ -12,6 +12,7 @@ tcib_actions:
# to the tcib file so the subsequent image let the operator set temporary permissions
# on the openshift uid for ansible to work.
- run: chmod g=u /etc/passwd /etc/group
- run: chmod -R 777 /usr/share/ansible
- workdir: /usr/share/ansible/roles
- run: >-
if [ -f "$TRIPLEO_ANSIBLE_REQ" ]; then