summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/transform-no-free-form.transformed.yml
blob: e947c345affe82d5acd4bcc4d7487478c91d5c28 (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
30
---
- name: Example with discouraged free-form syntax
  hosts: localhost
  tasks:
    - name: Create a placefolder file
      ansible.builtin.command: # <-- don't use shorthand
        chdir: /tmp
        cmd: touch foo
      changed_when: false

    - name: Create a placefolder file
      ansible.builtin.command: # <-- command can also go first
        chdir: /tmp
        cmd: touch bar
      changed_when: false

    - name: Use raw to echo
      ansible.builtin.raw: echo foo # <-- don't use executable=
      args:
        executable: /bin/bash
      changed_when: false

    - name: Example task with usage for '=' as module params
      ansible.builtin.debug:
        msg: "'Hello there world'"
      changed_when: false

    - name: Task that has a non-debug string with spaces
      ansible.builtin.set_fact:
        foo: '"String with spaces"'