Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network module docs 2.3 #22454

Merged
merged 12 commits into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 8 additions & 14 deletions lib/ansible/modules/network/eos/eos_banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,21 @@
options:
banner:
description:
- The C(banner) argument specifies the banner that should be
configured on the remote device. Current this module supports
configuration of either C(login) or C(motd) banners.
- Specifies which banner that should be
configured on the remote device.
required: true
default: null
choices: ['login', 'banner']
text:
description:
- The C(text) argument specifics the banner text that should be
- The banner text that should be
present in the remote device running configuration. This argument
accepts a multiline string.
required: false
accepts a multiline string. Requires I(state=present).
default: null
state:
description:
- The C(state) argument specifies whether or not the configuration is
present in the current devices active running configuration. When
this value is set to C(present), the configuration stanzas should be
in the current device configuration. When this value is set to
C(absent), the configuration should not be in the current running
configuration.
required: false
- Specifies whether or not the configuration is
present in the current devices active running configuration.
default: present
choices: ['present', 'absent']
"""
Expand Down Expand Up @@ -88,7 +82,7 @@
- EOF
session_name:
description: The EOS config session name used to load the configuration
returned: always
returned: if changes
type: str
sample: ansible_1479315771
"""
Expand Down
44 changes: 15 additions & 29 deletions lib/ansible/modules/network/eos/eos_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,55 +36,41 @@
options:
hostname:
description:
- The C(hostname) argument will configure the device hostname
parameter on Arista EOS devices. The C(hostname) value is an
ASCII string value.
required: false
default: null
- Configure the device hostname parameter. This option takes an ASCII string value.
domain_name:
description:
- The C(description) argument will configure the IP domain name
on the remote device to the provided value. The C(domain_name)
argument should be in the dotted name form and will be
- Configure the IP domain name
on the remote device to the provided value. Value
should be in the dotted name form and will be
appended to the C(hostname) to create a fully-qualified
domain name
required: false
default: null
domain_list:
domain name.
domain_search:
description:
- The C(domain_list) provides the list of domain suffixes to
- Provides the list of domain suffixes to
append to the hostname for the purpose of doing name resolution.
This argument accepts a list of names and will be reconciled
with the current active configuration on the running node.
required: false
default: null
lookup_source:
description:
- The C(lookup_source) argument provides one or more source
- Provides one or more source
interfaces to use for performing DNS lookups. The interface
provided in C(lookup_source) can only exist in a single VRF. This
argument accepts either a list of interface names or a list of
hashes that configure the interface name and VRF name. See
examples.
required: false
default: null
name_servers:
description:
- The C(name_serves) argument accepts a list of DNS name servers by
way of either FQDN or IP address to use to perform name resolution
lookups. This argument accepts wither a list of DNS servers or
- List of DNS name servers by IP address to use to perform name resolution
lookups. This argument accepts either a list of DNS servers or
a list of hashes that configure the name server and VRF name. See
examples.
required: false
default: null
state:
description:
- The C(state) argument configures the state of the configuration
- State of the configuration
values in the device's current active configuration. When set
to I(present), the values should be configured in the device active
configuration and when set to I(absent) the values should not be
in the device active configuration
required: false
default: present
choices: ['present', 'absent']
"""
Expand All @@ -93,7 +79,7 @@
- name: configure hostname and domain-name
eos_system:
hostname: eos01
domain_name: eng.ansible.com
domain_name: test.example.com

- name: remove configuration
eos_system:
Expand Down Expand Up @@ -131,10 +117,10 @@
type: list
sample:
- hostname eos01
- ip domain-name eng.ansible.com
- ip domain-name test.example.com
session_name:
description: The EOS config session name used to load the configuration
returned: when changed is True
returned: changed
type: str
sample: ansible_1479315771
"""
Expand Down Expand Up @@ -301,7 +287,7 @@ def main():
hostname=dict(),

domain_name=dict(),
domain_list=dict(type='list'),
domain_list=dict(type='list', aliases=['domain_search']),

# { interface: <str>, vrf: <str> }
lookup_source=dict(type='list'),
Expand Down
37 changes: 11 additions & 26 deletions lib/ansible/modules/network/eos/eos_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,71 +41,56 @@
Arista EOS device. The list entries can either be the username
or a hash of username and properties. This argument is mutually
exclusive with the C(username) argument.
required: false
default: null
username:
description:
- The username to be configured on the remote Arista EOS
device. This argument accepts a stringv value and is mutually
exclusive with the C(users) argument.
required: false
default: null
update_password:
description:
- Since passwords are encrypted in the device running config, this
argument will instruct the module when to change the password. When
set to C(always), the password will always be updated in the device
and when set to C(on_create) the password will be updated only if
the username is created.
required: false
default: always
choices: ['on_create', 'always']
privilege:
description:
- The C(privilege) argument configures the privilege level of the
user when logged into the system. This argument accepts integer
values in the range of 1 to 15.
required: false
default: null
role:
description:
- The C(role) argument configures the role for the username in the
- Configures the role for the username in the
device running configuration. The argument accepts a string value
defining the role name. This argument does not check if the role
has been configured on the device.
required: false
default: null
sshkey:
description:
- The C(sshkey) argument defines the SSH public key to configure
for the username. This argument accepts a valid SSH key value.
required: false
default: null
- Specifies the SSH public key to configure
for the given username. This argument accepts a valid SSH key value.
nopassword:
description:
- The C(nopassword) argument defines the username without assigning
- Defines the username without assigning
a password. This will allow the user to login to the system
without being authenticated by a password. This argument accepts
boolean values.
required: false
default: null
choices: ['true', 'false']
without being authenticated by a password.
type: bool
purge:
description:
- The C(purge) argument instructs the module to consider the
- Instructs the module to consider the
resource definition absolute. It will remove any previously
configured usernames on the device with the exception of the
`admin` user which cannot be deleted per EOS constraints.
required: false
type: bool
default: false
state:
description:
- The C(state) argument configures the state of the uername definition
- Configures the state of the username definition
as it relates to the device operational configuration. When set
to I(present), the username(s) should be configured in the device active
configuration and when set to I(absent) the username(s) should not be
in the device active configuration
required: false
default: present
choices: ['present', 'absent']
"""
Expand All @@ -121,7 +106,7 @@
eos_user:
purge: yes

- name: set multiple users to privilege level
- name: set multiple users to privilege level 15
users:
- username: netop
- username: netend
Expand Down Expand Up @@ -301,7 +286,7 @@ def main():
""" main entry point for module execution
"""
argument_spec = dict(
users=dict(type='list', no_log=True),
users=dict(type='list'),
username=dict(),

password=dict(no_log=True),
Expand Down
47 changes: 17 additions & 30 deletions lib/ansible/modules/network/ios/ios_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,61 +36,45 @@
options:
hostname:
description:
- The C(hostname) argument will configure the device hostname
parameter on Cisco IOS devices. The C(hostname) value is an
ASCII string value.
required: false
default: null
- Configure the device hostname parameter. This option takes an ASCII string value.
domain_name:
description:
- The C(description) argument will configure the IP domain name
on the remote device to the provided value. The C(domain_name)
argument should be in the dotted name form and will be
- Configure the IP domain name
on the remote device to the provided value. Value
should be in the dotted name form and will be
appended to the C(hostname) to create a fully-qualified
domain name
required: false
default: null
domain name.
domain_search:
description:
- The C(domain_list) provides the list of domain suffixes to
- Provides the list of domain suffixes to
append to the hostname for the purpose of doing name resolution.
This argument accepts a list of names and will be reconciled
with the current active configuration on the running node.
required: false
default: null
lookup_source:
description:
- The C(lookup_source) argument provides one or more source
- Provides one or more source
interfaces to use for performing DNS lookups. The interface
provided in C(lookup_source) must be a valid interface configured
on the device.
required: false
default: null
lookup_enabled:
description:
- The C(lookup_enabled) argument provides administrative control
- Administrative control
for enabling or disabling DNS lookups. When this argument is
set to True, lookups are performed and when it is set to False,
lookups are not performed.
required: false
default: null
choices: ['true', 'false']
type: bool
name_servers:
description:
- The C(name_serves) argument accepts a list of DNS name servers by
way of either FQDN or IP address to use to perform name resolution
lookups. This argument accepts wither a list of DNS servers See
- List of DNS name servers by IP address to use to perform name resolution
lookups. This argument accepts either a list of DNS servers See
examples.
required: false
default: null
state:
description:
- The C(state) argument configures the state of the configuration
- State of the configuration
values in the device's current active configuration. When set
to I(present), the values should be configured in the device active
configuration and when set to I(absent) the values should not be
in the device active configuration
required: false
default: present
choices: ['present', 'absent']
"""
Expand All @@ -99,18 +83,21 @@
- name: configure hostname and domain name
ios_system:
hostname: ios01
domain_name: eng.ansible.com
domain_name: test.example.com
domain-search:
- ansible.com
- redhat.com
- cisco.com

- name: remove configuration
ios_system:
state: absent

- name: configure DNS lookup sources
ios_system:
lookup_source: MgmtEth0/0/CPU0/0
lookup_enabled: yes

- name: configure name servers
ios_system:
name_servers:
Expand All @@ -125,7 +112,7 @@
type: list
sample:
- hostname ios01
- ip domain name eng.ansible.com
- ip domain name test.example.com
"""
import re

Expand Down