ansible / proposals

Repository for sharing and tracking progress on enhancement proposals for Ansible.
Creative Commons Zero v1.0 Universal
93 stars 19 forks source link

Add properties and 'settings' to roles. #95

Open boxrick opened 6 years ago

boxrick commented 6 years ago

Proposal: Add properties to roles

Author: Rick Box <@boxrick> IRC: boxrick

Date: 22/01/2018

Motivation

I have situations where I wish for a role to be used in a certain way, ie everything inside of it tagged or have something like 'local_action' or perhaps even a when condition.

Problems

As it stands the only way to do this is place this condition on every single task in the role or do it at playbook level, however much of the time I cannot dictate how people create a playbook.

What problems exist that this proposal will solve?

Solution proposal

The idea here is to have a properties type folder within a role which allows you set conditions or properties for the entirety of that role which is already achievable from the playbook level but instead make this part of the role itself.

Anything that can be applied to a role at the playbook level should be allowed to be set inside of this properties folder.

Documentation (optional)

This will require some additional documentation under role usage.

bcoca commented 6 years ago

block can do much of this for all the tasks in the role and you only need to state it one time