diff --git a/alchemy.yml b/alchemy.yml new file mode 100644 index 0000000..db00384 --- /dev/null +++ b/alchemy.yml @@ -0,0 +1,25 @@ +--- +- name: Simple Non-Root Playbook + hosts: localhost + gather_facts: false + tasks: + - name: 1. Check who is running the playbook + ansible.builtin.command: whoami + register: user_check + + - name: 2. Print the username to the console + ansible.builtin.debug: + msg: "This playbook is running as user {{ user_check.stdout }}" + + - name: 3. Create a test file in the home directory + ansible.builtin.copy: + content: "Hello, this file was created using Ansible without sudo!" + dest: "~/ansible_test_file.txt" + + - name: 4. Verify the file contents + ansible.builtin.command: cat ~/ansible_test_file.txt + register: file_output + + - name: 5. Display the file output + ansible.builtin.debug: + msg: "{{ file_output.stdout }}"