This commit is contained in:
@@ -48,7 +48,10 @@ def build_cmdLine_args(rc):
|
|||||||
rc.cmdline_args=""
|
rc.cmdline_args=""
|
||||||
process_private_Keyfile(rc);
|
process_private_Keyfile(rc);
|
||||||
if(os.environ.get('ANSIBLE_PLAYBOOK_REMOTE_USER') is not None):
|
if(os.environ.get('ANSIBLE_PLAYBOOK_REMOTE_USER') is not None):
|
||||||
|
print("---------------------------------------")
|
||||||
|
print("remote user:")
|
||||||
print(os.environ.get('ANSIBLE_PLAYBOOK_REMOTE_USER'))
|
print(os.environ.get('ANSIBLE_PLAYBOOK_REMOTE_USER'))
|
||||||
|
print("---------------------------------------")
|
||||||
rc.cmdline_args += " -u " + os.environ.get('ANSIBLE_PLAYBOOK_REMOTE_USER')
|
rc.cmdline_args += " -u " + os.environ.get('ANSIBLE_PLAYBOOK_REMOTE_USER')
|
||||||
|
|
||||||
|
|
||||||
@@ -67,11 +70,23 @@ def execute_playbook():
|
|||||||
rc.cmdline_args += "--limit 127.0.0.1 --connection local"
|
rc.cmdline_args += "--limit 127.0.0.1 --connection local"
|
||||||
|
|
||||||
rc.prepare()
|
rc.prepare()
|
||||||
print(rc.generate_ansible_command());
|
print("---------------------------------------")
|
||||||
|
print("command:")
|
||||||
|
print(rc.generate_ansible_command())
|
||||||
|
print("---------------------------------------")
|
||||||
r = Runner(config=rc)
|
r = Runner(config=rc)
|
||||||
r.run()
|
r.run()
|
||||||
|
|
||||||
|
def list_workspace():
|
||||||
|
print("---------------------------------------")
|
||||||
|
print("workspace files:")
|
||||||
|
items=os.listdir("/workspace")
|
||||||
|
for image in items:
|
||||||
|
print(image)
|
||||||
|
print("---------------------------------------")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
list_workspace();
|
||||||
execute_playbook()
|
execute_playbook()
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user