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

Auto mkdirs when copying file #3759

Closed
iven opened this issue Aug 5, 2013 · 3 comments
Closed

Auto mkdirs when copying file #3759

iven opened this issue Aug 5, 2013 · 3 comments

Comments

@iven
Copy link

iven commented Aug 5, 2013

An option should be added to create required directories when copying file if they don't exist.

For example, when copying pip.conf to $HOST/root/.pip/, we may meet following error:

msg: Destination directory /root/.pip does not exist

I think /root/.pip should be automatically created (or at least add an option and let the user decide.)

@mpdehaan
Copy link
Contributor

mpdehaan commented Aug 6, 2013

I disagree with this, because you really do need to set a permissions for the directory as well as the file.

Just add a task before that says:

  • file: path=/some/dir/to/wherever state=directory

and consider passing ownership and mode parameters.

@mpdehaan mpdehaan closed this as completed Aug 6, 2013
@fewknow
Copy link

fewknow commented Nov 10, 2016

@mpdehaan it should set the default permissions for the directory. As it does in your example....you are not setting permissions for the directory, but allowing the defaults. Having to add this is annoying at best.

@hadrien-toma
Copy link

hadrien-toma commented Sep 14, 2017

@mpdehaan so, maybe this should be re-opened?

@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
None yet
Projects
None yet
Development

No branches or pull requests

4 participants