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

adds FAQ TOC entry, links & examples to modules #38706

Merged
merged 7 commits into from
Apr 18, 2018
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
1 change: 1 addition & 0 deletions docs/docsite/rst/network/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ For documentation on using a particular network module, consult the :doc:`list o
:caption: User Guide

user_guide/index
user_guide/faq
user_guide/network_best_practices_2.5
user_guide/network_debug_troubleshooting
user_guide/network_working_with_command_output
Expand Down
10 changes: 10 additions & 0 deletions lib/ansible/modules/network/eos/eos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
extends_documentation_fragment: eos
notes:
- Tested against EOS 4.15
- Abbreviated commands are NOT idempotent, see
L(Network FAQ,../network/user_guide/faq.html#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands).
options:
lines:
description:
Expand Down Expand Up @@ -234,6 +236,14 @@
eos_config:
diff_against: intended
intended_config: "{{ lookup('file', 'master.cfg') }}"

- name: for idempotency, use full-form commands
eos_config:
lines:
# - shut
- shutdown
# parents: int eth1
parents: interface Ethernet1
"""

RETURN = """
Expand Down
10 changes: 10 additions & 0 deletions lib/ansible/modules/network/ios/ios_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
extends_documentation_fragment: ios
notes:
- Tested against IOS 15.6
- Abbreviated commands are NOT idempotent, see
L(Network FAQ,../network/user_guide/faq.html#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands).
options:
lines:
description:
Expand Down Expand Up @@ -261,6 +263,14 @@
- name: save running to startup when modified
ios_config:
save_when: modified

- name: for idempotency, use full-form commands
ios_config:
lines:
# - shut
- shutdown
# parents: int gig1/0/11
parents: interface GigabitEthernet1/0/11
"""

RETURN = """
Expand Down
10 changes: 10 additions & 0 deletions lib/ansible/modules/network/iosxr/iosxr_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
notes:
- Tested against IOS XRv 6.1.2
- This module does not support netconf connection
- Abbreviated commands are NOT idempotent, see
L(Network FAQ,../network/user_guide/faq.html#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands).
- Avoid service disrupting changes (viz. Management IP) from config replace.
- Do not use C(end) in the replace config file.
options:
Expand Down Expand Up @@ -151,6 +153,14 @@
src: config.cfg
replace: config
backup: yes

- name: for idempotency, use full-form commands
iosxr_config:
lines:
# - shut
- shutdown
# parents: int g0/0/0/1
parents: interface GigabitEthernet0/0/0/1
"""

RETURN = """
Expand Down
8 changes: 8 additions & 0 deletions lib/ansible/modules/network/junos/junos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
notes:
- This module requires the netconf system service be enabled on
the remote device being managed.
- Abbreviated commands are NOT idempotent, see
L(Network FAQ,../network/user_guide/faq.html#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands).
- Loading JSON-formatted configuration I(json) is supported
starting in Junos OS Release 16.1 onwards.
- Tested against vSRX JUNOS version 15.1X49-D15.4, vqfx-10000 JUNOS Version 15.1X53-D60.4.
Expand Down Expand Up @@ -155,6 +157,12 @@
- name: confirm a previous commit
junos_config:
confirm_commit: yes

- name: for idempotency, use full-form commands
junos_config:
lines:
# - set int ge-0/0/1 unit 0 desc "Test interface"
- set interfaces ge-0/0/1 unit 0 description "Test interface"
"""

RETURN = """
Expand Down
10 changes: 10 additions & 0 deletions lib/ansible/modules/network/nxos/nxos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@
argument, the task should also modify the C(diff_against) value and
set it to I(intended).
version_added: "2.4"
notes:
- Abbreviated commands are NOT idempotent, see
L(Network FAQ,../network/user_guide/faq.html#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands).
"""

EXAMPLES = """
Expand Down Expand Up @@ -244,6 +247,13 @@
replace_src: config.txt
replace: config

- name: for idempotency, use full-form commands
nxos_config:
lines:
# - shut
- shutdown
# parents: int eth1/1
parents: interface Ethernet1/1
"""

RETURN = """
Expand Down
8 changes: 8 additions & 0 deletions lib/ansible/modules/network/vyos/vyos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
extends_documentation_fragment: vyos
notes:
- Tested against VYOS 1.1.7
- Abbreviated commands are NOT idempotent, see
L(Network FAQ,../network/user_guide/faq.html#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands).
options:
lines:
description:
Expand Down Expand Up @@ -100,6 +102,12 @@
vyos_config:
src: vyos.cfg
backup: yes

- name: for idempotency, use full-form commands
vyos_config:
lines:
# - set int eth eth2 description 'OUTSIDE'
- set interface ethernet eth2 description 'OUTSIDE'
"""

RETURN = """
Expand Down