Commit 6d403481 authored by David Wilson's avatar David Wilson

examples: simplify example playbooks.

parent 14251539
...@@ -2,5 +2,8 @@ ...@@ -2,5 +2,8 @@
- hosts: all - hosts: all
gather_facts: false gather_facts: false
roles: tasks:
- connection_local - name: "Run hostname"
connection: local
command: hostname
with_sequence: start=1 end=100
---
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
- name: "My Role"
connection: local
command: hostname
---
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
- name: "My Role"
command: hostname
---
- name: "This command should run as the SSH user"
command: whoami
- name: "This command should run as root"
become: true
command: whoami
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
- hosts: all - hosts: all
gather_facts: false gather_facts: false
roles: tasks:
- run_hostname_100_times - name: "Run hostname"
command: hostname
with_sequence: start=1 end=100
--- ---
- hosts: all - hosts: all
roles: tasks:
- whoami - name: "This command should run as the SSH user"
command: whoami
register: whoami
- name: "Verify non-become user is correct"
assert:
that: "whoami.stdout == '{{ansible_user_id}}'"
- name: "This command should run as root"
become: true
command: whoami
register: whoami
- name: "Verify become user is correct"
assert:
that: "whoami.stdout == 'root'"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment