First inventory & playbook
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
; first-inventory.ini
|
||||||
|
[my-localhost]
|
||||||
|
127.0.0.1 ansible_connection=local
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user