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

Support scripts dir in roles #2969

Closed
fdavis opened this issue May 22, 2013 · 6 comments · Fixed by #3017
Closed

Support scripts dir in roles #2969

fdavis opened this issue May 22, 2013 · 6 comments · Fixed by #3017

Comments

@fdavis
Copy link

fdavis commented May 22, 2013

Could we extend roles to support scripts?

So

- script: myscript.sh

Gets automagically sucked up from, roles/myrole/scripts/myscript.sh

?

@srgvg
Copy link
Contributor

srgvg commented May 22, 2013

+1
now I have to put those files outside the role

@mpdehaan
Copy link
Contributor

I think this should be possible.

Patches would be accepted. Leaving this open.

@mcodd
Copy link
Contributor

mcodd commented May 25, 2013

This is something I was just wishing for the other day too, great to see it! My only comment would be whether it makes more sense to search for these scripts in roles/$role/files instead of a new subdirectory called scripts? In my case I would rather have them in files/ because then you wouldn't have to duplicate file between scripts/ and files/ if you sometimes wanted to use it with copy and sometimes with script...

@srgvg
Copy link
Contributor

srgvg commented May 25, 2013

@mcodd having a separate scripts/ directory is conform files/ and templates/; I used to put regular files in templates/ to (before we had roles), but with roles, it makes more sense to standardize, imho.

Also, I'm not sure what your use case would be to use the same file both as a script resource, and as a files (or even templates) resource?

The same goes for e.g. tasks (or files or templates, ..) you'd use in several roles. As to not duplicate the content, I keep a master file at a certain place, and just symlink them if I have to reuse them.

@mpdehaan
Copy link
Contributor

I would also be inclined to agree with mcodd here, we are copying these
over verbatim, and it keeps from having too many directories (or having to
document things extra)

It should still also fallback to looking in the current spot as I mentioned
if that file didn't exist.

On Sat, May 25, 2013 at 9:52 AM, Serge van Ginderachter <
notifications@github.com> wrote:

@mcodd https://github.com/mcodd having a separate scripts/ directory is
conform files/ and templates/; I used to put regular files in templates/ to
(before we had roles), but with roles, it makes more sense to standardize,
imho.

Also, I'm not sure what your use case would be to use the same file both
as a script resource, and as a files (or even templates) resource?

The same goes for e.g. tasks (or files or templates, ..) you'd use in
several roles. As to not duplicate the content, I keep a pmaster fle at a
certain place, and just symlink them if I have to reuse them.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2969#issuecomment-18447503
.

@srgvg
Copy link
Contributor

srgvg commented May 25, 2013

OK for me.

mpdehaan pushed a commit that referenced this issue May 29, 2013
allows to put scripts directly in a dir within the
role:

 roles/<role>/scripts/..

Same as the copy and template module.

As requested in and closes #2969
@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

Successfully merging a pull request may close this issue.

4 participants