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

draft Network FAQ #38359

Merged
merged 1 commit into from
Apr 11, 2018
Merged

draft Network FAQ #38359

merged 1 commit into from
Apr 11, 2018

Conversation

acozine
Copy link
Contributor

@acozine acozine commented Apr 5, 2018

SUMMARY

Closes #37935
Closes #37866
Closes #37637
Closes #37413

Introduces a Network FAQ for 2.5 to the documentation.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

Network Documentation

ANSIBLE VERSION

2.5 and higher

@acozine acozine requested a review from gundalow April 5, 2018 20:33
@acozine acozine added this to Docsite work in Ansible-maintained Collections Documentation via automation Apr 5, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 5, 2018

@ansibot ansibot added docs This issue/PR relates to or includes documentation. needs_triage Needs a first human triage before being processed. networking Network category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 5, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 5, 2018

The test ansible-test sanity --test rstcheck [explain] failed with 1 error:

docs/docsite/rst/network/user_guide/faq.rst:1:0: malformed hyperlink target.

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 5, 2018
@acozine acozine moved this from Docsite work to In progress in Ansible-maintained Collections Documentation Apr 5, 2018
@ansibot ansibot removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 5, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Apr 6, 2018
Copy link
Contributor

@gundalow gundalow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a few ideas about formatting, readability and links

How can I improve performance for network playbooks?
====================================================

* Set ``strategy: free`` at the playbook level if you are running on multiple hosts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if each of the "hows" should be separate headings with anchors. Would improve formatting and give us the ability to link directly to the relevant section

Looking at the rendered version the current bullet point version looks a bit strange to me

====================================================

* Set ``strategy: free`` at the playbook level if you are running on multiple hosts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like:

What is this option
When would this make sense (i.e. how do you know if this is something to consider)


* Set ``strategy: free`` at the playbook level if you are running on multiple hosts

The ``strategy`` plugin controls the ordering of tasks on hosts. When ``strategy=linear``, Ansible will wait until the current task has run on all hosts before starting the next host. When ``strategy=free``, Ansible will execute the next task on each host as soon as that host completes the current task, so overall execution is not waiting for the slowest host.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we should link to the linear and free pages though these seem low in detail

http://docs.ansible.com/ansible/latest/user_guide/playbooks_strategies.html
https://docs.ansible.com/ansible/devel/plugins/strategy/linear.html
https://docs.ansible.com/ansible/devel/plugins/strategy/free.html

I wonder if we should flesh those pages out a bit and include links from here. That would mean as the reference material is improved we guide people to those pages.


* Use ``ProxyCommand`` only if you absolutely must

Network modules support the use of a jump host with the ``ProxyCommand`` parameter. However, when you use a jump host, Ansible must open a new SSH connection for every task, even if you are using a persistent connection type (``network_cli`` or ``netconf``). To maximize the performance benefits of the persistent connection types introduced in version 2.5, avoid using jump hosts whenever possible.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to proxy details

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is my output sometimes replaced with "********"?
====================================================

Ansible replaces any string marked ``no_log``, including passwords, with ``********`` in Ansible output. This is done by design, to protect your sensitive data. Most users are happy to have their passwords redacted. However, Ansible replaces every string that matches your password with ``********``. If you use a common word for your password, this can be a problem. For example, if you choose ``Admin`` as your password, Ansible will replace every instance of the word ``Admin`` with ``********`` in your output. This may make your output harder to read. To avoid this problem, select a password that will not occur elsewhere in your Ansible output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: select a password -> select a secure password

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, good idea

Ansible Network FAQ
*******************

How can I improve performance for network playbooks?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@privateip had a way of avoiding all the skipped tasks (network_os) which may be relevant for this section. He mentioned it during the four playbook exercises in Durham

Why do the ``*_config`` modules always return ``changed=true`` with short-form commands?
========================================================================================

When you are issuing commands directly on a network device, you can use long-form and short-form commands interchangeably. For example ``interface`` and ``int`` have the same effect. Ansible's ``*_command`` modules return the same results no matter which form of the command you use, because they run those commands through the network OS. However, behind the scenes, the network OS will convert short-form commands into long-form before committing the state of the configuration. Ansible's ``*_config`` modules check the difference between the command provided and the existing configuration. Because existing configuration is always expressed long-form, using the short-form commands with the ``*_config`` modules will always return ``changed=true``, even when the state of the configuration matches the short-form command given. To avoid this problem and make your playbooks more efficient, use long-form commands with the ``*_config`` modules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change to headings (rather than bullet points) I wonder if we could split this block of text up a bit to increase readability.

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Apr 6, 2018

.. _network_faq_redacted_output:

Why is my output sometimes replaced with "********"?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these quotes be backticks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, thanks

@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. labels Apr 10, 2018

Ansible's ``*_config`` modules check the difference between the commands provided and the running configuration. Because existing configuration is always expressed long-form, the ``*_config`` modules will always return ``changed=true`` if you use abbreviations.

To avoid this problem and make your playbooks more efficient, use long-form commands with the ``*_config`` modules:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Explain what's meant by efficient, or just remove that term?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I clarified this. Comments in this section addressed by 2b28b394b4b1bf37681fd71eaa492a7a312e62c5

Why do the ``*_config`` modules always return ``changed=true`` with abbreviated commands?
=========================================================================================

When you issue commands directly on a network device, you can use abbreviated commands. For example, ``int g1/0/11`` and ``interface GigabitEthernet1/0/11`` do the same thing; ``shut`` and ``shutdown`` do the same thing. Ansible's ``*_command`` modules work with abbreviations, because they run commands through the network OS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did the short form example get removed?

suggestion: do the same thing -> are functionally identical?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-thought that example. If we include sample tasks or playbooks demonstrating the wrong way to do things, customers can copy/paste those by mistake. In the porting guides, we need to include examples of the "old" way to help customers upgrade their playbooks. But elsewhere the examples should all be correct and current.


When committing configuration, however, the network OS converts abbreviations into full descriptions. In the above example, whether you use ``shut`` or ``shutdown`` to close the port on ``GigabitEthernet1/0/1``, the result in the running config is the same: ``shutdown``.

Ansible's ``*_config`` modules check the difference between the commands provided and the running configuration. Because existing configuration is always expressed long-form, the ``*_config`` modules will always return ``changed=true`` if you use abbreviations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: check the text difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I've made some changes to this bit and I think it's better now

@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Apr 11, 2018
@dharmabumstead dharmabumstead merged commit ea99cf3 into ansible:devel Apr 11, 2018
Ansible-maintained Collections Documentation automation moved this from In progress to Done Apr 11, 2018
@acozine acozine moved this from Done to Backport to 2.5 in Ansible-maintained Collections Documentation Apr 12, 2018
acozine pushed a commit to acozine/ansible that referenced this pull request Apr 12, 2018
(cherry picked from commit ea99cf3)
@acozine acozine moved this from Backport to 2.5 to Done in Ansible-maintained Collections Documentation Apr 13, 2018
acozine pushed a commit that referenced this pull request Apr 13, 2018
(cherry picked from commit ea99cf3)
@acozine acozine deleted the network_faq branch April 13, 2018 16:50
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs This issue/PR relates to or includes documentation. networking Network category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
No open projects
6 participants