-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface_rpc.yaml
57 lines (49 loc) · 1.34 KB
/
interface_rpc.yaml
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: Get Device Interfaces
hosts: vmx1
roles:
- Juniper.junos
connection: local
gather_facts: no
vars:
- name: Set authorized key took from file
authorized_key:
user: fortinet
state: present
key: "{{ lookup('file', '/home/mis/.ssh/id_rsa.pub') }}"
# vars_prompt:
# - name: username
# propmpt: Junos username
# private: no
# - name: password
# prompt: Junos password
# private: yes
tasks:
- name: gathering info from device
juniper_junos_rpc:
rpcs:
- get-interface-information
formats: xml # options xml,json, text
dest_dir: '.'
return_output: no
# kwargs:
# detail: True
# interface_name: ge-0/0/0
# junos_get_facts: host={{ inventory_hostname }}
# juniper_junos_rpc:
# rpcs:
# - get-system-uptime-information
provider:
host: "{{ ansible_host }}"
# user: "{{ username }}"
# password: "{{ password }}"
# port: 22 #if commented out use NETCONF default port 830
register: interfaces
- name: display interfaces
debug:
var: interfaces
# var: uptime['stdout_lines'][6]
verbosity: 0
# when: uptime.parsed_output['system-uptime-information'] is defined
# - debug:
# var: ansible_host