saltstack-formulas / icinga2-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
19 stars 28 forks source link

feat(config) remove interfering users.conf #41

Open alxwr opened 3 years ago

alxwr commented 3 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

None.

Describe the changes you're proposing

Under FreeBSD 12, the package for Icinga 2.12.3 users.conf contains a user group (icingaadmins) which interferes with commonly used config. Removing this unmanaged file resolves this conflict.

Pillar / config required to test the proposed changes

None.

Debug log showing how the proposed changes work

┌─[salt-master@salt]─[~]
└─╼ % salt --state-output=changes --state-verbose=False 'minion' state.apply icinga2
minion:
----------
ID: /usr/local/etc/icinga2/conf.d/users.conf
Function: file.absent
Result: True
Comment: Removed file /usr/local/etc/icinga2/conf.d/users.conf
Started: 15:43:53.571146
Duration: 0.89 ms
Changes:
----------
removed:
/usr/local/etc/icinga2/conf.d/users.conf
----------
ID: icinga2_service_restart
Function: service.running
Name: icinga2
Result: True
Comment: Service icinga2 is already enabled, and is running
Started: 15:43:53.603166
Duration: 1413.839 ms
Changes:
----------
icinga2:
True

Summary for minion
--------------
Succeeded: 183 (changed=2)
Failed:      0
--------------
Total states run:     183
Total run time:     2.092 s

Documentation checklist

Testing checklist

Additional context

baby-gnu commented 3 years ago

The inspec is not run by the pipeline because no platform is enable in .gitlab-ci.yml.

myii commented 3 years ago

@alxwr Ran this locally to see what's preventing the service from running and this is what I've found (using journalctl -xe):

icinga2[6551]: [] critical/config: Error: Validation failed for object 'alice' of type 'User'; Attribute 'groups': Object 
icinga2[6551]: Location: in /etc/icinga2/conf.d/users/alice.conf: 4:3-4:29
icinga2[6551]: /etc/icinga2/conf.d/users/alice.conf(2): object User "alice" {
icinga2[6551]: /etc/icinga2/conf.d/users/alice.conf(3):   email = "alice@example.test"
icinga2[6551]: /etc/icinga2/conf.d/users/alice.conf(4):   groups = [ "icingaadmins" ]
icinga2[6551]:                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
icinga2[6551]: /etc/icinga2/conf.d/users/alice.conf(5):   vars.jabber = "alice@jabber.example.test"
icinga2[6551]: /etc/icinga2/conf.d/users/alice.conf(6): }
icinga2[6551]: [] critical/config: 1 error
icinga2[6551]: [] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.