debops / ansible-apache

Manage and configure the Apache HTTP Server
GNU General Public License v3.0
2 stars 6 forks source link

Add support for apache__dependent_modules #16

Open scibi opened 7 years ago

scibi commented 7 years ago

Hi!

What do you think about supporting apache__dependent_modules (by default set to {}) and setting apache__combined_modules like that?

apache__combined_modules: '{{ apache__dependent_modules
                              | combine(apache__role_modules)
                              | combine(apache__modules) 
                              | combine(apache__group_modules) 
                              | combine(apache__host_modules) }}' 
ypid commented 7 years ago

Could be done. I initially avoided this because Ansible has apache2_module which roles should prefer but now with all the sugar that debops.apache has to offer, apache__dependent_modules could make sense. Do you have a specific usecase in mind where apache__dependent_modules would be superior over plain apache2_module?

Also note that the config option of apache__dependent_modules would not be idempotent if apache__dependent_modules would be supported. I guess in that case the solution does not need to be technical, it could just be noted that config is unsupported for apache__dependent_modules and filter it out if it is used anyway using Jinja.

scibi commented 7 years ago

Hi!

I usually use nginx so I use debops.nginx as a dependency. I was forced to use Apache in one project. I replaced it with debops.apache. Apache is working as a plain reverse proxy so I just needed to enable proxy and proxy_http. That's all. It's easier to use variable than adding apache2_module especially when I wanted to be able to switch back to nginx.

In my case config is not used so I don't care about loosing idempotence.

ypid commented 7 years ago

Thanks for the feedback. Ok, I can see this being useful in your case. @drybjed What do you think about this?

ypid commented 7 years ago

Thanks for explaining. Your use case is reasonable and you are free to implement it as discussed/described in https://github.com/debops/ansible-apache/issues/16#issuecomment-281206229.

drybjed commented 7 years ago

Adding support for apache__dependent_modules should be fine, as long as idempotency is preserved. If there are changes to the configuration state when debops.apache role is executed by itself versus as a dependent role with some configuration, changes should be tracked by the debops.apache role to avoid that issue. Are there any options that need to be tracked in this way?

ypid commented 7 years ago

I would avoid this for now. See https://github.com/debops/ansible-apache/issues/16#issuecomment-281206229