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

Added example to include wait_for command - Issue 311 #41069

Closed
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
7 participants
@jvanderaa
Copy link

jvanderaa commented Jun 4, 2018

… command.

SUMMARY

Example including a single command output with a wait_for

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

Network Cisco ASA

ANSIBLE VERSION
$ ansible --version
ansible 2.5.3
  config file = None
  configured module search path = [u'/Users/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Oct  6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
ADDITIONAL INFORMATION

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Jun 4, 2018

@Akasurde Akasurde removed the needs_triage label Jun 4, 2018

@Akasurde Akasurde changed the title Added example to inlcude wait_for command - Issue 311 Added example to include wait_for command - Issue 311 Jun 4, 2018

@beeankha

This comment has been minimized.

Copy link
Contributor

beeankha commented Jun 7, 2018

Hello @jvanderaa , thank you for submitting a PR to this repo. We'll be testing before merging, so stay tuned and we'll update with a comment as we go through the queue!

@ansibot ansibot added the stale_ci label Jun 15, 2018

@acozine

This comment has been minimized.

Copy link
Contributor

acozine commented Jun 22, 2018

Hi @jvanderaa we'd like to see a playbook and output showing that the new example works - see the Validation section of ansible/community#311 for the rules, and @IPvSean's comment on #40369 for an idea of what to do. Reach out if you have questions. Thanks!

@beeankha

This comment has been minimized.

Copy link
Contributor

beeankha commented Jul 19, 2018

@jvanderaa , just pinging to see if you could rebase + provide the info requested above by @acozine . If we don't hear back from you by the end of this month (July 2018), we'll close this PR out.

@jvanderaa

This comment has been minimized.

Copy link
Author

jvanderaa commented Jul 19, 2018

Yeah I can. Been a crazy few weeks for me. Apologies for delay.

@jvanderaa

This comment has been minimized.

Copy link
Author

jvanderaa commented Jul 24, 2018

$ ansible-playbook asa_example.yml -i ./hosts

PLAY [Show ASA Wait for Result] **************************************************************************************************

TASK [ASA>> Get Ping output] *****************************************************************************************************
[DEPRECATION WARNING]: Param 'auth_pass' is deprecated. See the module docs for more information. This feature will be removed in
 version 2.9. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: Param 'timeout' is deprecated. See the module docs for more information. This feature will be removed in
version 2.9. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [asav-1]

TASK [debug] *********************************************************************************************************************
ok: [asav-1] => {
    "msg": [
        "Type escape sequence to abort.",
        "Sending 101, 350-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:",
        "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
        "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
        "Success rate is 100 percent (101/101), round-trip min/avg/max = 20/37/60 ms"
    ]
}

PLAY RECAP ***********************************************************************************************************************
asav-1                     : ok=2    changed=0    unreachable=0    failed=0
Updated asa_command
updated to match the output
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Jul 24, 2018

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

lib/ansible/modules/network/asa/asa_command.py:103:41: W291 trailing whitespace

click here for bot help

@beeankha

This comment has been minimized.

Copy link
Contributor

beeankha commented Aug 1, 2018

Hi @jvanderaa, thank you so much for your updates! We would still like to see the full example playbook pasted into this thread so we can test this PR. As an added note, please ensure that you name each task in the playbook (a brief description about why that particular task is being executed) so that we can keep track of the output we get on our end.

@jvanderaa

This comment has been minimized.

Copy link
Author

jvanderaa commented Aug 2, 2018

Sure thing, apologies.

---
- name: Show ASA Wait for Result
  hosts: asa_examples
  connection: network_cli
  gather_facts: no

  tasks:
    - name: ASA>> Get Ping output
      asa_command:
        commands:
          - ping 8.8.8.8 repeat 101 size 350
        authorize: yes
        auth_pass: "{{ ansible_become_pass }}"
        wait_for:
          - result[0] contains 100
        timeout: 100
        retries: 2
      register: ping_output

    - debug:
        msg: "{{ ping_output.stdout_lines.0 }}"

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Sep 2, 2018

@samccann

This comment has been minimized.

Copy link
Contributor

samccann commented Sep 6, 2018

Closing this PR in favour of this new one:
https://github.com/ansible/ansible/pull/45190

  • removed some deprecated items and added titles to all the examples for asa_command.

Thanks again @jvanderaa for participating in the challenge and you will get credit for this addition! BTW - it would be helpful in the future if you used a topic branch for ansible changes. It makes it easier for someone to pop into your topic branch and make a few minor edits before merging. I didn't want to do that to your devel, so I created a new PR for this.

@samccann samccann closed this Sep 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.