-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdebug.yml
More file actions
56 lines (54 loc) · 1.76 KB
/
debug.yml
File metadata and controls
56 lines (54 loc) · 1.76 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#- name: debug
# hosts: vpn_server
# tasks:
# - debug:
# msg: System {{ inventory_hostname }} has uuid {{ ansible_product_uuid }}
#
#
# - name: system command
# routeros_facts:
# gather_subset: all
# register: system_print
# - name: debug print
# debug: var=system_print.ansible_facts.ansible_net_all_ipv4_addresses[0]
#
#- name: set name
# routeros_command:
# commands: /system identity set name={{ inventory_hostname }}
# tags:
# - identity
#
#- name: disable unnecessary services
# routeros_command:
# commands: "/ip service disable {{ item }}"
# loop:
# - ftp
# - telnet
# - api
# - api-ssl
# - www-ssl
# tags:
# - service_disable
#
#- name: set allowed addresses for services
# command: ssh -T {{ansible_ssh_user}}@{{ansible_host}} "/ip service set www address={{ lan_subnets | join(',')}}"
# tags:
# - service_address
#- name: debug
# hosts: vpn_server
# tasks:
# - command: "ssh -T {{ansible_ssh_user}}@{{ansible_host}} '/ip address print'"
#- name: VPN
# hosts: vpn_server
# roles:
# - routeros-l2tp-server
- name: debug
hosts: vpn_server
tasks:
- debug:
msg: "{{ groups['vpn_server'] | map('extract', hostvars, ['vpn_clients'].values()) }}"
#msg: "{{ groups['vpn_server'] | map('extract', hostvars, ['vpn_clients']) | join(',') }}"
#msg: "{{ ['name'] | map('extract', groups['vpn_server'] | map('extract', hostvars, ['vpn_clients'])) | join(',') }}"
#msg: "{{ groups['vpn_server'] | map('extract', hostvars, ['vpn_clients']) | join(',') }}"
#msg: "{{ ['name','password'] | map('extract', {'address': '10.254.0.1', 'name': 'bubnov', 'ospf_cost': 10, 'password': 'QWERTY'}) | list }}"
# msg: "{{ groups['vpn_server'] | map('extract', hostvars, ['vpn_clients']) | join(',') }}"