commit 267cbfddb50a0127ab109228196fb9e6986e9b5b Author: Olu Date: Sat Jan 25 08:19:20 2025 +0000 First inventory & playbook diff --git a/first-inventory.ini b/first-inventory.ini new file mode 100644 index 0000000..76f6ad1 --- /dev/null +++ b/first-inventory.ini @@ -0,0 +1,3 @@ +; first-inventory.ini +[my-localhost] +127.0.0.1 ansible_connection=local diff --git a/first-playbook.yml b/first-playbook.yml new file mode 100644 index 0000000..6df2c14 --- /dev/null +++ b/first-playbook.yml @@ -0,0 +1,15 @@ +# first-playbook.yml +--- +- name: Basic tasks + # This host is defined in the `first-inventory.ini` + hosts: my-localhost + tasks: + - name: Execute uptime command + command: uptime + register: uptime_result + - debug: var=uptime_result.stdout_lines + + - name: Check OS release + command: sw_vers + register: os_result + - debug: var=os_result.stdout_lines