-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
41 lines (35 loc) · 874 Bytes
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- gather_facts: false
hosts: localhost
tasks:
- command:
cmd: "docker-compose up -d"
- add_host:
name: web1
ansible_connection: httpapi
ansible_host: 127.0.0.1
ansible_network_os: testing
ansible_httpapi_port: 8001
- add_host:
name: web2
ansible_connection: httpapi
ansible_host: 127.0.0.1
ansible_network_os: testing
ansible_httpapi_port: 8002
- add_host:
name: web3
ansible_connection: httpapi
ansible_host: 127.0.0.1
ansible_network_os: testing
ansible_httpapi_port: 8003
- gather_facts: false
hosts: all
collections:
- mynamespace.mycollection
tasks:
- debug:
msg: "{{ ansible_httpapi_port }}"
- my_module:
register: output_value
- debug:
msg: "{{ output_value }}"