Skip to content

[BUG] On CentOS 7, enabled modules are reported as changed on every highstate #371

@iaingeorgeson

Description

@iaingeorgeson

Your setup

Formula commit hash / release tag

apache-formula v1.1.8

Versions reports (master & minion)

Salt 3003.3
Master: Debian 10
Minion: CentOS 7.8.2003

Pillar / config used

In pillar:

apache:
  modules:
    enabled:
      - proxy
      - proxy_ajp
      - proxy_http
      - rewrite
      - autoindex
    disabled:
      - access_compat
      - status

include
  - apache.config.modules
  ...

Bug details

Describe the bug

On CentOS 7, the formula does not try to detect whether modules are already enabled. Therefore it tries to use sed to enable the listed modules on every highstate, interprets the command as causing a change, and restarts httpd.

Steps to reproduce the bug

Use apache-formula to manage apache on CentOS 7 -

List modules in pillar under
apache:
modules:
enabled:

and include apache.config.modules.

Expected behaviour

Only report a change, and therefore only restart httpd, when the configuration is actually changed.

Attempts to fix the bug

The quick fix is probably to activate the onlyif test for CentOS 7 as well as Arch in

https://github.com/saltstack-formulas/apache-formula/blob/v1.1.8/apache/config/modules/install.sls#L27

A better fix would probably for this formula to completely rewrite the apache configuration, and manage it in the same way on every OS.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions