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
Feature request: support for relative copying from inventories folder #37426
Comments
@mat013 Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information. Here are the items we could not find in your description:
Please set the description of this issue with this template: |
@mat013 you are probably going to be better off adding this proposal to the next Ansible meeting and talking about it there ansible/community#296. |
Thanks. I will look at it when I am back from vacation. |
We voted in irc meeting and decided to decline the proposal |
I found a workaround for the issue which is to add a variable in the group_vars/all file e.g.: files_resources: "{{ inventory_dir + '/roles/' + role_name + 'files' }}" And then prefix where ever the filepath is needed e.g. {{ lookup_file('file', files_resource + '/... |
Feature Idea
COMPONENT NAME
Ansible
SUMMARY
In the best practice section of the ansible documentation
http://docs.ansible.com/ansible/latest/playbooks_best_practices.html#alternative-directory-layout
it is suggested that the organisation of files are split by each inventory that one makes in this case per environment. It gives the advantage that anything, which is relevant for that particular environment are organised together. Currently only values are supported. I would like to propose an extension/enhancement to this idea, which is to be able to place files which are only relevant to a particular environment. e.g. SSL certificates.
And then it should be possible for the copy task to locate to the files by referring relative.
In the following example when using the copy task and referring relative to the webserver role, then searching for the file will only be carried out in the roles/webserver/files tasks. My proposal is that assuming the inventory is the inventories/production/hosts then when referring relative in a copy task for the webserver role should look in inventories/production/roles/webserver/files as well, and it should have higher precedence than roles/webserver/files
The motivation behind this proposal is:
The text was updated successfully, but these errors were encountered: