diff --git a/ansible/playbooks/roles/common/tasks/basic_checks.yaml b/ansible/playbooks/roles/common/tasks/basic_checks.yaml new file mode 100644 index 0000000..6cb42ac --- /dev/null +++ b/ansible/playbooks/roles/common/tasks/basic_checks.yaml @@ -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 + \ No newline at end of file