# Choosing from conflicting values in multiple roles

**URL:** <https://forum.ansible.com/t/choosing-from-conflicting-values-in-multiple-roles/15940>\
**Category:** Ansible Project\
**Created:** [August 14, 2014, 3:50am UTC](https://forum.ansible.com/t/choosing-from-conflicting-values-in-multiple-roles/15940 "2014-08-14T03:50:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_Shprentz](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@Joel\_Shprentz](https://forum.ansible.com/u/Joel_Shprentz)\
**Post date:** [August 14, 2014, 3:50am UTC](https://forum.ansible.com/t/choosing-from-conflicting-values-in-multiple-roles/15940/1 "2014-08-14T03:50:25Z")

</div>

The Zabbix installation manual recommends some settings in /etc/php5/apache2/php.ini:

`  
post\_max\_size = 16M  
max\_execution\_time = 300  
max\_input\_time = 300  
date.timezone = UTC

`

Other PHP applications have different recommendations. Here are a few recommended values for post\_max\_size, for example:

Drupal: 10M  
PHPMyAdmin: 20M  
Wordpress: 8M

Ansible roles for Drupal, PHPMyAdmin, Wordpress, and Zabbix could assure their settings with tasks using the lineinfile module or a Jinja2 template for php.ini.

What happens if two or more PHP applications are installed on the same host? Each role configures its preferred value and the last role to execute wins.

In the post\_max\_size example, I think that the final configured value should be the maximum from the relevant roles for that host. For other parameters, the preferred value might be the minimum, the average, or some other function of the available values. In some cases, such as timezone, conflicting values should cause an assertion to fail so an administrator can resolve the problem.

Has anyone else encountered this problem? Have you found an approach for tracking a maximum (or minimum, etc.) value across multiple roles and using the maximum in a task?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 14, 2014, 12:14pm UTC](https://forum.ansible.com/t/choosing-from-conflicting-values-in-multiple-roles/15940/2 "2014-08-14T12:14:34Z")

</div>

In your case, I recommend setting feature bits for things, or keying of the group in a template.

{% if inventory\_hostname in groups[‘webservers’] %}

{% else %}

{% endif %}

etc

{% if needs\_more\_power|defined %}

{% endif %}

etc

---

<div class="post-metadata">

**Author:** ![Tom\_Bamford1](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@Tom\_Bamford1](https://forum.ansible.com/u/Tom_Bamford1)\
**Post date:** [August 14, 2014, 12:32pm UTC](https://forum.ansible.com/t/choosing-from-conflicting-values-in-multiple-roles/15940/3 "2014-08-14T12:32:14Z")

</div>

Instead of looking to Ansible to work around this shared global setting,  
have you considered configuring these values per virtualhost?

Regards
