This commit is contained in:
Gary Kwok
2024-01-26 15:43:35 +08:00
commit 3bb1fb28bb
5 changed files with 26 additions and 0 deletions

4
ansible.cfg Normal file
View File

@@ -0,0 +1,4 @@
[defaults]
inventory = ./inventory
roles_path = ./roles
host_key_checking = False

9
inventory Normal file
View File

@@ -0,0 +1,9 @@
[all]
pvgapp1 ansible_host=192.168.11.121
pvgapp2 ansible_host=192.168.11.122
pvgapp3 ansible_host=192.168.11.123
[staging]
pvgapp1 ansible_host=192.168.11.121
pvgapp2 ansible_host=192.168.11.122
pvgapp3 ansible_host=192.168.11.123

5
main.yml Normal file
View File

@@ -0,0 +1,5 @@
---
- name: main task
hosts: staging
roles:
- role: hello_world

View File

@@ -0,0 +1,7 @@
---
- name: show remote host
debug:
msg: "the remote server is {{ ansible_host }}"
- name: show vars of this playbook
debug:
msg: "{{ greeting }}"

View File

@@ -0,0 +1 @@
greeting: "hello ansible-playbook"