From 8204dc69e7dbd492eb2b5963ee0ce96548c844d2 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 15 Feb 2018 00:27:05 +0545 Subject: [PATCH] ansible: add become test case --- examples/playbook/roles/whoami/tasks/main.yml | 8 ++++++++ examples/playbook/whoami.yml | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 examples/playbook/roles/whoami/tasks/main.yml create mode 100644 examples/playbook/whoami.yml diff --git a/examples/playbook/roles/whoami/tasks/main.yml b/examples/playbook/roles/whoami/tasks/main.yml new file mode 100644 index 00000000..7555946f --- /dev/null +++ b/examples/playbook/roles/whoami/tasks/main.yml @@ -0,0 +1,8 @@ +--- + +- name: "This command should run as the SSH user" + command: whoami + +- name: "This command should run as root" + become: true + command: whoami diff --git a/examples/playbook/whoami.yml b/examples/playbook/whoami.yml new file mode 100644 index 00000000..133941f8 --- /dev/null +++ b/examples/playbook/whoami.yml @@ -0,0 +1,6 @@ +--- + + +- hosts: all + roles: + - whoami