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

whitespace breaks module name parsing in local_action #62136

Closed
rnowagk opened this issue Sep 11, 2019 · 2 comments · Fixed by #71040
Closed

whitespace breaks module name parsing in local_action #62136

rnowagk opened this issue Sep 11, 2019 · 2 comments · Fixed by #71040
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@rnowagk
Copy link

rnowagk commented Sep 11, 2019

SUMMARY

Extra whitespace between a local_action module and the first argument is treated as part of the module name and leads to 'module not found' errors in 2.8.4. (It works in 2.7.0.)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible-playbook

ANSIBLE VERSION
ansible 2.8.4
  config file = None
  configured module search path = [u'/home/centos/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jun 20 2019, 20:27:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
CONFIGURATION
<nothing>
OS / ENVIRONMENT

CentOS Linux release 7.6.1810 (Core)

STEPS TO REPRODUCE
- hosts: localhost
  gather_facts: false

  tasks:
     - name: one space
       local_action: set_fact a="a"

     - name: more spaces
       local_action: set_fact     b="b"
EXPECTED RESULTS

all ok; as with 2.7.0:

...
PLAY RECAP *****************************************************************************************************************************************************
localhost                  : ok=3    changed=1    unreachable=0    failed=0
ACTUAL RESULTS

fails; note the whitespace after 'set_facts' in the error message

PLAY [localhost] ***********************************************************************************************************************************************

TASK [one space] ***********************************************************************************************************************************************
ok: [localhost -> localhost]

TASK [more spaces] *********************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The module set_fact     was not found in configured module paths. Additionally, core modules are missing. If this is a checkout, run 'git pull --rebase' to correct this problem."}

PLAY RECAP *****************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
@ansibot
Copy link
Contributor

ansibot commented Sep 11, 2019

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 ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 11, 2019
@sivel
Copy link
Member

sivel commented Sep 11, 2019

Likely caused by b72e989 although I haven't bisected.

@sivel sivel added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Sep 17, 2019
relrod added a commit to relrod/ansible that referenced this issue Aug 1, 2020
Change:
- When an action is called like "action: copy foo=bar", strip spaces
  around the action name.
- This allows "action: copy        foo=bar" to work as expected.

Test Plan:
- New integration tests

Tickets:
- Fixes ansible#62136

Signed-off-by: Rick Elrod <rick@elrod.me>
relrod added a commit to relrod/ansible that referenced this issue Aug 2, 2020
Change:
- When an action is called like "action: copy foo=bar", strip spaces
  around the action name.
- This allows "action: copy        foo=bar" to work as expected.

Test Plan:
- New integration tests

Tickets:
- Fixes ansible#62136

Signed-off-by: Rick Elrod <rick@elrod.me>
bcoca pushed a commit that referenced this issue Aug 3, 2020
* Strip spaces in module names in explicit actions

Change:
- When an action is called like "action: copy foo=bar", strip spaces
  around the action name.
- This allows "action: copy        foo=bar" to work as expected.

Test Plan:
- New integration tests

Tickets:
- Fixes #62136

Signed-off-by: Rick Elrod <rick@elrod.me>
zoredache pushed a commit to zoredache/ansible that referenced this issue Aug 10, 2020
* Strip spaces in module names in explicit actions

Change:
- When an action is called like "action: copy foo=bar", strip spaces
  around the action name.
- This allows "action: copy        foo=bar" to work as expected.

Test Plan:
- New integration tests

Tickets:
- Fixes ansible#62136

Signed-off-by: Rick Elrod <rick@elrod.me>
@ansible ansible locked and limited conversation to collaborators Aug 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. P3 Priority 3 - Approved, No Time Limitation 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