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

Fetch module does not understand sudo #3111

Closed
rrtj3 opened this issue Jun 3, 2013 · 7 comments
Closed

Fetch module does not understand sudo #3111

rrtj3 opened this issue Jun 3, 2013 · 7 comments
Assignees
Labels
feature This issue/PR relates to a feature request.

Comments

@rrtj3
Copy link
Contributor

rrtj3 commented Jun 3, 2013

Testing some of the things I do in 1.1 on 1.2 and notice that 'fetch' is failing for me on a playbook where it used to work fine.

- hosts: odb*
  user: username 
  sudo: true
  gather_facts: false
  serial: 20

  tasks:


   - name: Fetch /etc/init.d/dbora
     fetch: src=/etc/init.d/dbora dest=/home/username/fetch/dbora/

This is now failing on most hosts whereas it worked fine on all hosts on 1.1. The error I'm getting with -v is:

fatal: [odb27.pvt.hawaii.edu] => failed to transfer file from /etc/init.d/dbora
fatal: [odb39.pvt.hawaii.edu] => failed to transfer file from /etc/init.d/dbora
fatal: [odb41.pvt.hawaii.edu] => failed to transfer file from /etc/init.d/dbora
fatal: [odb42.pvt.hawaii.edu] => failed to transfer file from /etc/init.d/dbora

It seems that fetch is now trying to grab the file before sudoing, or something similar, whereas before this worked fine.

@mpdehaan
Copy link
Contributor

mpdehaan commented Jun 3, 2013

I'm not sure it ever did though.

The idea is fetch would have to revert to slurp usage when it couldn't
access directly.

We never implemented that.

On Mon, Jun 3, 2013 at 3:46 PM, Romeo Theriault notifications@github.comwrote:

Testing some of the things I do in 1.1 on 1.2 and notice that 'fetch' is
failing for me on a playbook where it used to work fine.

  • hosts: odb*
    user: username
    sudo: true
    gather_facts: false
    serial: 20

    tasks:

    • name: Fetch /etc/init.d/dbora
      fetch: src=/etc/init.d/dbora dest=/home/username/fetch/dbora/

This is now failing on most hosts whereas it worked fine on all hosts on
1.1. The error I'm getting with -v is:

fatal: [odb27.pvt.hawaii.edu] => failed to transfer file from
/etc/init.d/dbora
fatal: [odb39.pvt.hawaii.edu] => failed to transfer file from
/etc/init.d/dbora
fatal: [odb41.pvt.hawaii.edu] => failed to transfer file from
/etc/init.d/dbora
fatal: [odb42.pvt.hawaii.edu] => failed to transfer file from
/etc/init.d/dbora

It seems that fetch is now trying to grab the file before sudoing, or
something similar, whereas before this worked fine.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3111
.

@rrtj3
Copy link
Contributor Author

rrtj3 commented Jun 3, 2013

Just tried again on 1.1 and it works great for me.

@mpdehaan
Copy link
Contributor

mpdehaan commented Jun 3, 2013

Perhaps this is something you would like to try to work on?

@rrtj3
Copy link
Contributor Author

rrtj3 commented Jun 3, 2013

Sure. I'll see if I can track down what changed in the fetch module between 1.1 and now and see if I can "fix" it or what the deal is. Pretty swamped at work so no promises on time but I'll see what I can do.

@rrtj3
Copy link
Contributor Author

rrtj3 commented Jun 4, 2013

I don't think I'll have time to track down the root cause of this for a while but I enabled verbose (-vvv) logging on 1.1 where it worked and 1.2 where it's not and put both of their outputs into a gist so you can see what's happening:

https://gist.github.com/romeotheriault/dd8e833797daf248afd0

Hope this helps.

@rrtj3
Copy link
Contributor Author

rrtj3 commented Jun 4, 2013

Tried the 1.1 fetch.py (/usr/lib/python2.6/site-packages/ansible/runner/action_plugins) on 1.2 to see if it was any of the changes to the fetch action_plugin which may be causing the issue. It still fails exactly the same way so it appears to be some change outside of the fetch action_plugin that's causing the issue.

@mpdehaan
Copy link
Contributor

We know fetch isn't sudo aware currently. See my previous comment about slurp.

I'll assume we never implemented it.

@ghost ghost assigned jimi-c Aug 15, 2013
@jimi-c jimi-c closed this as completed in faf82bf Aug 28, 2013
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 3, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

No branches or pull requests

4 participants