tests: fixes to get regression/ running under vanilla Ansible
This commit is contained in:
parent
b882b78d35
commit
d827bdb848
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash -ex
|
||||
# Run tests/ansible/integration/all.yml under Ansible and Ansible-Mitogen
|
||||
# Run tests/ansible/all.yml under Ansible and Ansible-Mitogen
|
||||
|
||||
TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-`pwd`}"
|
||||
TMPDIR="/tmp/ansible-tests-$$"
|
||||
|
@ -58,7 +58,7 @@ echo travis_fold:end:job_setup
|
|||
|
||||
echo travis_fold:start:mitogen_linear
|
||||
/usr/bin/time ./mitogen_ansible_playbook.sh \
|
||||
integration/all.yml \
|
||||
all.yml \
|
||||
-vvv \
|
||||
-i "${TMPDIR}/hosts"
|
||||
echo travis_fold:end:mitogen_linear
|
||||
|
@ -66,7 +66,7 @@ echo travis_fold:end:mitogen_linear
|
|||
|
||||
echo travis_fold:start:vanilla_ansible
|
||||
/usr/bin/time ./run_ansible_playbook.sh \
|
||||
integration/all.yml \
|
||||
all.yml \
|
||||
-vvv \
|
||||
-i "${TMPDIR}/hosts"
|
||||
echo travis_fold:end:vanilla_ansible
|
||||
|
|
|
@ -15,6 +15,11 @@ from ansible.plugins.action import ActionBase
|
|||
|
||||
class ActionModule(ActionBase):
|
||||
def run(self, tmp=None, task_vars=None):
|
||||
if not type(self._connection).__module__.startswith('ansible_mitogen'):
|
||||
return {
|
||||
'changed': False
|
||||
}
|
||||
|
||||
self._connection._connect()
|
||||
return {
|
||||
'changed': True,
|
||||
|
|
|
@ -13,6 +13,7 @@ import sys
|
|||
def main():
|
||||
module = AnsibleModule(argument_spec={})
|
||||
module.exit_json(
|
||||
argv=sys.argv,
|
||||
env=dict(os.environ),
|
||||
cwd=os.getcwd(),
|
||||
python_path=sys.path,
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
- assert:
|
||||
that:
|
||||
- env.cwd == ansible_user_dir
|
||||
- env.python_path.count("") == 1
|
||||
- (not env.mitogen_loaded) or (env.python_path.count("") == 1)
|
||||
|
||||
# Run some new-style modules that 'from ansible.module_utils...'
|
||||
- stat:
|
||||
|
|
Loading…
Reference in New Issue