v1
This commit is contained in:
4
ansible.cfg
Normal file
4
ansible.cfg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[defaults]
|
||||||
|
inventory = ./inventory
|
||||||
|
roles_path = ./roles
|
||||||
|
host_key_checking = False
|
||||||
9
inventory
Normal file
9
inventory
Normal 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
5
main.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: main task
|
||||||
|
hosts: staging
|
||||||
|
roles:
|
||||||
|
- role: hello_world
|
||||||
7
roles/hello_world/tasks/main.yml
Normal file
7
roles/hello_world/tasks/main.yml
Normal 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 }}"
|
||||||
1
roles/hello_world/vars/main.yml
Normal file
1
roles/hello_world/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
greeting: "hello ansible-playbook"
|
||||||
Reference in New Issue
Block a user