-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuptime.yaml
49 lines (41 loc) · 1.01 KB
/
uptime.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
---
- name: Get Device Uptime
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_command:
commands:
- show system uptime
# junos_get_facts: host={{ inventory_hostname }}
# juniper_junos_rpc:
# rpcs:
# - get-system-uptime-information
provider:
host: "{{ ansible_host }}"
# user: "{{ username }}"
# password: "{{ password }}"
port: 22
register: uptime
- name: display uptime
debug:
var: uptime['stdout_lines'][6]
verbosity: 1
# - debug:
# var: ansible_host