29
docker/scripts/run-ansible-playbook.py
Normal file
29
docker/scripts/run-ansible-playbook.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import os
|
||||
import sys
|
||||
from ansible_runner import Runner, RunnerConfig
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def executePlaybook():
|
||||
|
||||
rc = RunnerConfig(
|
||||
private_data_dir="/workspace"
|
||||
)
|
||||
|
||||
rc.playbook=os.environ.get('ANSIBLE_PLAYBOOK', "site.yml")
|
||||
rc.inventory=os.environ.get('ANSIBLE_PLAYBOOK_INVENTORY', "127.0.0.1,")
|
||||
if(rc.inventory=="127.0.0.1,"):
|
||||
rc.cmdline_args= "--limit 127.0.0.1 --connection local"
|
||||
rc.prepare()
|
||||
r = Runner(config=rc)
|
||||
r.run()
|
||||
|
||||
def main():
|
||||
executePlaybook()
|
||||
|
||||
main()
|
||||
|
||||
|
||||
|
||||
1
docker/scripts/ssh-test.bash
Normal file
1
docker/scripts/ssh-test.bash
Normal file
@@ -0,0 +1 @@
|
||||
echo ola mundo
|
||||
Reference in New Issue
Block a user