summaryrefslogtreecommitdiffstats
path: root/examples/example.yml
blob: 1ce910de0517a7f8ea880a32782546c874eee335 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
- hosts: webservers

  vars:
    oldskool: "1.2.3"
    bracket: "and close bracket"

  tasks:
    - name: unset variable
      action: command echo {{thisvariable}} is not set in this playbook

    - name: trailing whitespace
      action: command echo do nothing   

    - name: git check
      action: git a=b c=d

    - name: git check 2
      action: git version=HEAD c=d

    - name: git check 3
      git: version=a1b2c3d4 repo=xyz bobbins=d

    - name: executing git through command
      action: command git clone blah

    - name: executing git through command
      action: command chdir=bobbins creates=whatever /usr/bin/git clone blah

    - name: using git module
      action: git repo=blah

    - name: passing git as an argument to another task
      action: debug msg="{{item}}"
      with_items: 
        - git
        - bobbins

    - name: yum latest
      yum: state=latest name=httpd

    - debug: msg="task without a name"

    - name: apt latest
      apt: state=latest name=apache2

    - name: always run
      debug: msg="always_run is deprecated"
      always_run: true

    # empty task is currently accepted by ansible as valid code:
    -