saltstack-formulas / ntp-formula

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

issue with current logic in ntp.ng, always true condition + missing ubuntu conf #49

Closed ITJamie closed 3 years ago

ITJamie 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

Describe the changes you're proposing

currently using the ntp.ng formula on a fresh install of ubuntu 20.04

----------
          ID: ntp
    Function: pkg.installed
      Result: True
     Comment: All specified packages are already installed
     Started: 15:49:48.511202
    Duration: 74.385 ms
     Changes:
----------
          ID: ntpd_conf
    Function: file.managed
        Name: /etc/ntp.conf
      Result: True
     Comment: File /etc/ntp.conf is in the correct state
     Started: 15:49:48.586885
    Duration: 53.075 ms
     Changes:
----------
          ID: ntpd
    Function: service.None
        Name: ntp
      Result: False
     Comment: State 'service.None' was not found in SLS 'ntp.ng'
              Reason: 'service.None' is not available.
     Changes:

This is because right now the existing logic will always run as the mapped data supplied in ntp.ng will always trigger a potentially un-needed (depending on usecase) part of the conf. as this data is being merged with pillar data there is no way to remove the ntp:ng:settings:ntpd key. the variable can be overridden, but the key can not be removed. due to this the current logic check is pointless as it is ALWAYS true.

also the above logic is failing due to lack of ubuntu lookup hence the service.None failure. I would have expected being able to disable this service mgmt as there is an if statement around it, however that statement is always true(see above block)

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context