From 267cbfddb50a0127ab109228196fb9e6986e9b5b Mon Sep 17 00:00:00 2001 From: Olu Date: Sat, 25 Jan 2025 08:19:20 +0000 Subject: [PATCH] First inventory & playbook --- first-inventory.ini | 3 +++ first-playbook.yml | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 first-inventory.ini create mode 100644 first-playbook.yml 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