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

URI module does not support async mode #47660

Closed
lukasmrtvy opened this issue Oct 26, 2018 · 3 comments · Fixed by #47677
Closed

URI module does not support async mode #47660

lukasmrtvy opened this issue Oct 26, 2018 · 3 comments · Fixed by #47677
Assignees
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. net_tools Net-tools category support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@lukasmrtvy
Copy link

lukasmrtvy commented Oct 26, 2018

SUMMARY

Its not possible to use async mode with uri module.
Command module and get_url module can handle async mode, but does not provide same functionality as uri module.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

uri module

ANSIBLE VERSION
ansible 2.7.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/sysadmin/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0]
CONFIGURATION
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
OS / ENVIRONMENT

Ubuntu 18.04.1 LTS

STEPS TO REPRODUCE
 - uri:
    url: https://localhost:8089/services/server/health
    method: GET
    user: healthcheck
    password: healthcheck
    return_content: yes
  until: healthcheck.content is search('<s:key name=\"healthy\">green</s:key>')
  retries: 10
  delay: 10
  async: 45
  poll: 0
  register: healthcheck
EXPECTED RESULTS

Run uri task in async mode

ACTUAL RESULTS
fatal: [myserver1]: FAILED! => {"changed": false, "msg": "async is not supported for this task."}
fatal: [myserver2]: FAILED! => {"changed": false, "msg": "async is not supported for this task."}
Info

I can do something like this:

- shell: |
        for run in {1..10};
        do
           sleep 10
           curl -u healthcheck:healthcheck --max-time 10 -sSL -k https://localhost:8089/services/server/health | grep -q "<s:key name=\"health\">green</s:key>"
        done
    args:
      executable: /bin/bash
  async: 45
  poll: 0
  register: healthcheck

, but its not an ansible native way.

@ansibot
Copy link
Contributor

ansibot commented Oct 26, 2018

Hi @lukasmrtvy, thank you for submitting this issue!

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 26, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 26, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. net_tools Net-tools category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 26, 2018
@sivel sivel self-assigned this Oct 26, 2018
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Oct 26, 2018
@sivel sivel added the has_pr This issue has an associated PR. label Oct 26, 2018
sivel added a commit to sivel/ansible that referenced this issue Oct 26, 2018
…nsible#47677)

* Add missing self._supports_async to uri action plugin. Fixes ansible#47660

* Additional changes needed to support async

* Missed a call to execute_module
(cherry picked from commit 3633e21)

Co-authored-by: Matt Martz <matt@sivel.net>
sivel added a commit that referenced this issue Oct 26, 2018
* Add missing self._supports_async to uri action plugin. Fixes #47660

* Additional changes needed to support async

* Missed a call to execute_module
abadger pushed a commit that referenced this issue Oct 31, 2018
…47677)

* Add missing self._supports_async to uri action plugin. Fixes #47660

* Additional changes needed to support async

* Missed a call to execute_module
(cherry picked from commit 3633e21)

Co-authored-by: Matt Martz <matt@sivel.net>
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this issue Dec 4, 2018
* Add missing self._supports_async to uri action plugin. Fixes ansible#47660

* Additional changes needed to support async

* Missed a call to execute_module
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. net_tools Net-tools category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants