...
 
Commits (3)
......@@ -12,6 +12,12 @@ variables:
- pip install --upgrade --editable .
- set -eux
test-playbook-executable:
<<: *test
script: |
./example/playbook.yml
grep hello ./playbook.out
test-clones-main:
<<: *test
script: |
......@@ -21,7 +27,7 @@ test-clones-main:
test-clone-update:
<<: *test
script: |
bigsudo -v yourlabs.io/oss/yourlabs.bigsudo-example @localhost example_variable=$(pwd)/test2
bigsudo -v yourlabs.io/oss/yourlabs.bigsudo-example @localhost example_variable=$(pwd)/test2 update
grep update test2
test-clone-local:
......
......@@ -27,8 +27,7 @@ def _argv(*hosts, **variables):
# enforce py3 here ?
# argv += ['-e', 'ansible_python_interpreter=python3']
if not hosts:
hosts = ('localhost',)
hosts = hosts or ('localhost',)
inv = []
user = None
......@@ -269,7 +268,11 @@ def run(source, *hosts_or_tasks, **variables):
kwargs = dict(apply_tasks=tasks or ['main'])
kwargs.update(variables)
return role(source, *hosts, **kwargs)
if source.endswith('.yml'):
return playbook(source, *hosts, **kwargs)
else:
return role(source, *hosts, **kwargs)
console_script = cli2.ConsoleScript(
......
#!/usr/bin/env bigsudo
---
- hosts: '*'
tasks:
- shell: echo hello > {{ lookup('env', 'PWD') }}/playbook.out
- debug: msg='Success running example playbook !'