diff --git a/.gitignore b/.gitignore index 2df304e..dd5178b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ lib2/* services/zigbee2mqtt/volumes/* *.env .vscode/settings.json +gitignore/* +**.local \ No newline at end of file diff --git a/tests/docker-ansible/run-ansible-container.sh b/tests/docker-ansible/run-ansible-container.sh new file mode 100755 index 0000000..4d78f11 --- /dev/null +++ b/tests/docker-ansible/run-ansible-container.sh @@ -0,0 +1,8 @@ + docker image pull git.limbosolutions.com/kb/ansible + docker run --rm \ + -v ${PWD}/scripts:/scripts \ + -v ${PWD}/workspace:/workspace \ + -v ${MY_ANSIBLE_PRIVATE_KEY_FILE}/id_ed25519:/data/ansible_private_key \ + git.limbosolutions.com/kb/ansible \ + bash /scripts/run.sh + diff --git a/tests/docker-ansible/scripts/run.sh b/tests/docker-ansible/scripts/run.sh new file mode 100644 index 0000000..a7056f0 --- /dev/null +++ b/tests/docker-ansible/scripts/run.sh @@ -0,0 +1,11 @@ +#/bin/bash + + +source /scripts/.env.local +echo $ANSIBLE_PRIVATE_KEY > /root/ansible_private_key +source /scripts/.env.local +cd /workspace +chmod 600 /root/ansible_private_key +cat /root/ansible_private_key +export ANSIBLE_HOST_KEY_CHECKING=False +$ANSIBLE_COMMAND diff --git a/tests/docker-ansible/workspace/site.yml b/tests/docker-ansible/workspace/site.yml new file mode 100644 index 0000000..f43aaa6 --- /dev/null +++ b/tests/docker-ansible/workspace/site.yml @@ -0,0 +1,9 @@ +- name: Homesrv01 playbook + hosts: all + tasks: + - name: Ping my hosts + ansible.builtin.ping: + + - name: Print message + ansible.builtin.debug: + msg: Hello world