Debian Codegraph @

test/integration/targets/want_json_modules_posix/tasks/main.yml

raw
1 - name: Hello, World!
2 helloworld:
3 register: hello_world
4
5 - assert:
6 that:
7 - 'hello_world.msg == "Hello, World!"'
8
9 - name: Hello, Ansible!
10 helloworld:
11 args:
12 name: Ansible
13 register: hello_ansible
14
15 - assert:
16 that:
17 - 'hello_ansible.msg == "Hello, Ansible!"'
18
19 - name: Goodbye, Ansible!
20 helloworld:
21 args:
22 salutation: Goodbye
23 name: Ansible
24 register: goodbye_ansible
25
26 - assert:
27 that:
28 - 'goodbye_ansible.msg == "Goodbye, Ansible!"'
29
30 - name: Copy module to remote
31 copy:
32 src: "{{ role_path }}/library/helloworld.py"
33 dest: "{{ remote_tmp_dir }}/helloworld.py"
34
35 - name: Execute module directly
36 command: '{{ ansible_python_interpreter|default(ansible_playbook_python) }} {{ remote_tmp_dir }}/helloworld.py'
37 register: direct
38 ignore_errors: true
39
40 - assert:
41 that:
42 - direct is failed
43 - 'direct.stdout | from_json == {"msg": "No argument file provided", "failed": true}'