-
Notifications
You must be signed in to change notification settings - Fork 10
/
ciscosmb_gather_facts.yml
55 lines (48 loc) · 1.72 KB
/
ciscosmb_gather_facts.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- name: Gather Facts
gather_facts: yes
hosts: all
vars:
- configs_dir: configs
tasks:
- name: Host info
ansible.builtin.debug:
verbosity: 3
var: "hostvars"
###
# Collect data
#
- name: CiscoSMB - Gather Facts - subset default
community.ciscosmb.facts:
gather_subset:
- default
# when: ansible_network_os == 'community.ciscosmb.ciscosmb'
# - name: CiscoSMB - Gather Facts - subset config
# community.ciscosmb.facts:
# gather_subset:
# - config
# vars:
# ansible_become: yes
# # when: ansible_network_os == 'community.ciscosmb.ciscosmb'
- name: CSV output
ansible.builtin.debug:
verbosity: 1
msg:
- "{{ ansible_facts['net_hostname'] }};{{ ansible_facts['net_model'] }};{{ ansible_facts['net_serialnum'] }};{{ ansible_facts['net_version'] }};{{ ansible_facts['net_hw_version'] }}"
- name: Verbose output
ansible.builtin.debug:
verbosity: 2
msg:
- "Hostname: {{ ansible_facts['net_hostname'] }}"
- "Model: {{ ansible_facts['net_model'] }}"
- "SN: {{ ansible_facts['net_serialnum'] }}"
- "SW version {{ ansible_facts['net_version'] }}"
- "HW version: {{ ansible_facts['net_hw_version'] }}"
- "config: {{ ansible_facts['net_config'] | default('') }}"
# - name: Create configuration directory
# local_action: file path={{ configs_dir }} state=directory
# run_once: true
# check_mode: no
# changed_when: no
#
# - name: Save running config
# local_action: copy content={{ ansible_net_config }} dest={{ configs_dir }}/{{ inventory_hostname }}_net_config