saltstack-formulas / apache-formula

Set up and configure the Apache HTTP server
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
50 stars 285 forks source link

In Debian apache.config plays two opposite actions #285

Open gaetanars opened 3 years ago

gaetanars commented 3 years ago

When I use apache or apache.config state on Debian system, each run had some modified files : /etc/apache2/sites-available/000-default.conf

_apache.config.own_defaultvhost produce Name: /etc/apache2/sites-available/000-default.conf - Function: file.managed - Result: Changed and _apache.config.debian_full_ produce : Name: /etc/apache2/sites-available/000-default.conf - Function: file.absent - Result: Changed

Have I missed some pillars to block this double change or is that a bug in this formula?

Regards

noelmcloughlin commented 3 years ago

I recently did a refactoring of this formula but did not add that code.

The file.absent state already existed in debian_full.sls file. If it is a bug and debian_full state is not doing anything useful - please consider raising a PR to remove that line from apache.config.init.sls and apache.config.clean files.

I do not know what òwn_default_vhostanddebian_full` states are for. If they are useful then updating the README to explain why would help. Since these are tiny PRs I hope you could contribute. thanks.

Here are the original lines before my last refactor PR.

/etc/apache2/sites-available/{{ apache.default_site }}:
  file.absent:
    - require:
      - pkg: apache
/etc/apache2/sites-available/{{ apache.default_site_ssl }}:
  file.absent:
    - require:
      - pkg: apache