summaryrefslogtreecommitdiff
path: root/test/integration/targets/template/ansible_managed_79129.yml
blob: e00ada8c10acc14f4f6b856728c37a5546af1eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
- hosts: testhost
  gather_facts: false
  tasks:
    - set_fact:
        output_dir: "{{ lookup('env', 'OUTPUT_DIR') }}"

    - name: check strftime
      block:
        - template:
            src: "templates/%necho Onii-chan help Im stuck;exit 1%n.j2"
            dest: "{{ output_dir }}/79129-strftime.sh"
            mode: '0755'

        - shell: "exec {{ output_dir | quote }}/79129-strftime.sh"

    - name: check jinja template
      block:
        - template:
            src: !unsafe "templates/completely{{ 1 % 0 }} safe template.j2"
            dest: "{{ output_dir }}/79129-jinja.sh"
            mode: '0755'

        - shell: "exec {{ output_dir | quote }}/79129-jinja.sh"
          register: result

        - assert:
            that:
              - "'Hello' in result.stdout"