basic checks
This commit is contained in:
parent
97863633d0
commit
7e3b65ca83
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
## Register output of whoami
|
||||||
|
- name: Who am I
|
||||||
|
ansible.builtin.command: whoami
|
||||||
|
register: _my_whoiam_var
|
||||||
|
|
||||||
|
## Displays variable as to stdout
|
||||||
|
- name: Debug
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: _my_whoiam_var.stdout
|
||||||
|
|
||||||
|
## Check if can write on tmp
|
||||||
|
- name: Check write operation
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: "Hello world"
|
||||||
|
dest: /tmp/{{ _my_whoiam_var.stdout}}.hello-world.txt
|
||||||
|
|
||||||
|
## Cleans up
|
||||||
|
- name: Clean up
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/{{ _my_whoiam_var.stdout}}.hello-world.txt
|
||||||
|
state: absent
|
||||||
|
|
||||||
Loading…
Reference in New Issue