summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/example.yml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/playbooks/example.yml')
-rw-r--r--examples/playbooks/example.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/examples/playbooks/example.yml b/examples/playbooks/example.yml
new file mode 100644
index 0000000..fa1a635
--- /dev/null
+++ b/examples/playbooks/example.yml
@@ -0,0 +1,49 @@
+---
+- name: Fixture for test_example
+ hosts: webservers
+ vars:
+ old_school: 1.2.3
+ bracket: and close bracket
+
+ tasks:
+ - name: Unset variable
+ action: ansible.builtin.command echo {{this_variable}} is not set in this playbook
+
+ - name: Trailing whitespace
+ action: ansible.builtin.command echo do nothing
+
+ - name: Run git check
+ action: ansible.builtin.git a=b c=d
+
+ - name: Run git check 2
+ action: ansible.builtin.git version=HEAD c=d
+
+ - name: Run git check 3
+ ansible.builtin.git: version=a1b2c3d4 repo=xyz bobbins=d
+
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+
+ - name: Executing git through command
+ action: ansible.builtin.command chdir=bobbins creates=whatever /usr/bin/git clone blah
+
+ - name: Using git module
+ action: ansible.builtin.git repo=blah
+
+ - name: Passing git as an argument to another task
+ action: ansible.builtin.debug msg="{{item}}"
+ with_items:
+ - git # yamllint wrong indentation
+ - bobbins
+
+ - name: Yum latest
+ ansible.builtin.yum: state=latest name=httpd
+
+ - ansible.builtin.debug: msg="debug task without a name"
+
+ - name: Run apt latest
+ ansible.builtin.apt: state=latest name=apache2
+
+ - ansible.builtin.meta: flush_handlers
+ # empty task is currently accepted by ansible as valid code but not our schemas:
+ -