Choosing from conflicting values in multiple roles

28 views
Skip to first unread message

Joel Shprentz

unread,
Aug 13, 2014, 11:50:25 PM8/13/14
to ansible...@googlegroups.com
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?

--
Joel Shprentz






Michael DeHaan

unread,
Aug 14, 2014, 8:14:37 AM8/14/14
to ansible...@googlegroups.com
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




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d46117c5-6eee-4361-946f-2d7f28abd02a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Bamford

unread,
Aug 14, 2014, 8:32:39 AM8/14/14
to ansible...@googlegroups.com
On 14 August 2014 05:50, Joel Shprentz <jshp...@his.com> wrote:

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?


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

Regards

--
Tom Bamford

@Planet
ATPLANET (Pty) Ltd

Reply all
Reply to author
Forward
0 new messages