From 7e3b65ca83c108c08f701137538f047fd1251775 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Thu, 13 Nov 2025 16:45:02 +0100 Subject: [PATCH] basic checks --- .../roles/common/tasks/basic_checks.yaml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ansible/playbooks/roles/common/tasks/basic_checks.yaml 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