Debian Codegraph @

test/integration/targets/shell-plugins/tasks/command-building.yml

raw
1 - vars:
2 atd: '{{ remote_tmp_dir }}/shell/t m p'
3 api: '{{ remote_tmp_dir }}/shell/p y t h o n'
4 block:
5 - name: create test dir
6 file:
7 path: '{{ atd|dirname }}'
8 state: directory
9
10 - name: create tempdir with spaces
11 file:
12 path: '{{ atd }}'
13 state: directory
14
15 - name: create symlink for ansible_python_interpreter to file with spaces
16 file:
17 dest: '{{ api }}'
18 src: '{{ ansible_facts.python.executable }}'
19 state: link
20
21 - name: run simple test playbook
22 command: >-
23 ansible-playbook -vvv -i inventory
24 -e 'ansible_python_interpreter="{{ api }}"'
25 -e 'ansible_pipelining=0'
26 "{{ role_path }}/test-command-building-playbook.yml"
27 environment:
28 ANSIBLE_REMOTE_TMP: '{{ atd }}'
29 ANSIBLE_NOCOLOR: "1"
30 ANSIBLE_FORCE_COLOR: "0"
31 TEST: "foo%D"
32 register: command_building
33 delegate_to: localhost
34
35 - debug:
36 var: command_building.stdout_lines
37
38 - block:
39 - debug:
40 var: py_cmd
41
42 - debug:
43 var: tmp_dir
44
45 - assert:
46 that:
47 - py_cmd in exec_line
48 - tmp_dir in exec_line
49 vars:
50 exec_line: '{{ command_building.stdout_lines | select("search", "EXEC.*p y t h o n") | first }}'
51 py_cmd: >-
52 '"'"'{{ api }}'"'"'
53 tmp_dir: >-
54 '"'"'{{ atd }}/ansible-tmp-