Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
287a7a0
iosl2 interface
justjais May 20, 2019
99a41d9
iosl2 interface
justjais May 20, 2019
9ac6f4c
iosl2 interface
justjais May 20, 2019
6206be3
iosl2 interface
justjais May 20, 2019
d80ba0b
iosl2 interface
justjais May 20, 2019
d08f735
iosl2 interface
justjais May 20, 2019
622c17a
iosl2 interface
justjais May 20, 2019
6bed031
iosl2 interface
justjais May 20, 2019
ad549bf
iosl2 interface
justjais May 20, 2019
5838a5c
iosl2 interface
justjais May 20, 2019
b9c6306
iosl2 interface
justjais May 20, 2019
6c4271f
iosl2 interface
justjais May 20, 2019
d3d9f4d
iosl2 interface
justjais May 20, 2019
49b7ee5
iosl2 interface
justjais May 20, 2019
f71da16
iosl2 interface
justjais May 20, 2019
ae96b0d
iosl2 interface
justjais May 20, 2019
bcd4200
iosl2 interface
justjais May 20, 2019
b74f9ad
iosl2 interface
justjais May 20, 2019
b68f6c8
iosl2 interface
justjais May 20, 2019
e4a019f
iosl2 interface
justjais May 20, 2019
726603d
iosl2 interface
justjais May 20, 2019
0f9472b
iosl2 interface
justjais May 20, 2019
d5bc3de
iosl2 interface
justjais May 20, 2019
d884fd1
iosl2 interface
justjais May 20, 2019
b00e44e
iosl2 interface
justjais May 20, 2019
f31ab53
iosl2 interface
justjais May 20, 2019
82a81f1
iosl2 interface
justjais May 20, 2019
7ffc94d
fix review comment
justjais May 22, 2019
f7bddfd
fix review comment
justjais May 22, 2019
a040684
fix idempotency
justjais May 23, 2019
2ff3b43
fix issue
justjais May 25, 2019
c28453b
fix issue
justjais May 25, 2019
d0ce5a6
fix issue
justjais May 25, 2019
0b42fa8
fix issue
justjais May 25, 2019
5b0523a
fix issue
justjais May 25, 2019
f8b16f7
fix old code
justjais Aug 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added library/__init__.py
Empty file.
85 changes: 85 additions & 0 deletions library/ios_facts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# {{ rm['COPYRIGHT'] }}
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The module file for {{ network_os }}_facts
"""

from __future__ import absolute_import, division, print_function

ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}

NETWORK_OS = "ios"
RESOURCE = "facts"
COPYRIGHT = "Copyright 2019 Red Hat"


DOCUMENTATION = """
---
module: ios_facts
version_added: 2.9
short_description: Collect facts from remote devices running Cisco IOS.
description:
- Collects facts from network devices running the ios operating
system. This module places the facts gathered in the fact tree keyed by the
respective resource name. The facts module will always collect a
base set of facts from the device and can enable or disable
collection of additional facts.
author: [u'Sumit Jaiswal (@justjais)']
notes:
- Tested against IOS Version 15.6(3)M2 on VIRL
options:
gather_subset:
description:
- When supplied, this argument will restrict the facts collected
to a given subset. Possible values for this argument include
all, and net_configuration_<resource_name>. Can specify a
list of values to include a larger subset. Values can also be used
with an initial C(M(!)) to specify that a specific subset should
not be collected.
required: false
default: 'all'
version_added: "2.2"
"""

EXAMPLES = """
# Gather all facts
- ios_facts:
gather_subset: all
# Collect only the interfaces and default facts
- ios_facts:
gather_subset:
- config
# Do not collect interfaces facts
- ios_facts:
gather_subset:
- "!hardware"
"""

RETURN = """
See the respective resource module parameters for the tree.
"""

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.connection import Connection
from ansible.module_utils.ios.facts.facts import Facts

def main():
"""
Main entry point for module execution
:returns: ansible_facts
"""
module = AnsibleModule(argument_spec=Facts.argument_spec,
supports_check_mode=True)
warnings = list()

connection = Connection(module._socket_path) #pylint: disable=W0212
gather_subset = module.params['gather_subset']
ansible_facts = Facts().get_facts(module, connection, gather_subset)
module.exit_json(ansible_facts=ansible_facts, warnings=warnings)

if __name__ == '__main__':
main()
Loading