saltstack-formulas / salt-formula

Yes, Salt can Salt itself!
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
197 stars 423 forks source link

[BUG] Recent MacOS commits cause problems in managing salt services #475

Closed prannonpendragas closed 4 years ago

prannonpendragas commented 4 years ago

Your setup

Formula commit hash / release tag

master

Versions reports (master & minion)

Salt Version: Salt: 3000.3

Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 2.6.1 docker-py: Not Installed gitdb: 2.0.3 gitpython: 2.1.8 Jinja2: 2.10 libgit2: Not Installed M2Crypto: 0.27.0 Mako: 1.0.7 msgpack-pure: Not Installed msgpack-python: 0.5.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: Not Installed Python: 2.7.17 (default, Apr 15 2020, 17:20:14) python-gnupg: 0.4.1 PyYAML: 3.12 PyZMQ: 16.0.2 smmap: 2.0.3 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.2.5

System Versions: dist: Ubuntu 18.04 bionic locale: UTF-8 machine: x86_64 release: 4.15.0-101-generic system: Linux version: Ubuntu 18.04 bionic

Pillar / config used

I'm using saltclass to manage my salt minions, and I am also using gitfs to obtain my salt formulas. Here are the basic pillars I'm using that should be relevant for testing this:

pillars:
  salt:
    minion:
      acceptance_wait_time: 10
      acceptance_wait_time_max: 120
      auth_timeout: 180
      id: "{{__grains__['id']}}"
      keysize: 2048
      master: "192.168.1.217"
      master_tries: "-1"
      max_event_size: 100000000
      random_reauth_delay: 270
      recon_default: 1000
      recon_max: 60000
      recon_randomize: True
      use_superseded:
        - ^
        - module.run

Bug details

Describe the bug

When attempting to run the salt.minion state or the salt.master state, I receive the following set of errors:

  Name: salt-minion - Function: pkg.installed - Result: Clean Started: - 06:57:29.191378 Duration: 1511.518 ms
  Name: /etc/salt/minion.d - Function: file.recurse - Result: Clean Started: - 06:57:30.703287 Duration: 923.891 ms
----------
          ID: salt-minion
    Function: service.running
      Result: False
     Comment: The following requisites were not found:
                                 watch:
                                     file: salt-master-macos
                                     file: salt-master
     Started: 06:57:31.634685
    Duration: 0.08 ms
     Changes:   
  Name: /etc/salt/minion.d/_defaults.conf - Function: file.absent - Result: Clean Started: - 06:57:31.644005 Duration: 0.893 ms
  Name: salt-call --local service.restart salt-minion --out-file /dev/null - Function: cmd.run - Result: Clean Started: - 06:57:31.646149 Duration: 0.015 ms
----------
          ID: salt-master
    Function: pkg.installed
      Result: True
     Comment: All specified packages are already installed
     Started: 07:05:19.978614
    Duration: 32.142 ms
     Changes:   
----------
          ID: salt-master
    Function: file.recurse
        Name: /etc/salt/master.d
      Result: True
     Comment: The directory /etc/salt/master.d is in the correct state
     Started: 07:05:20.013480
    Duration: 343.485 ms
     Changes:   
----------
          ID: salt-master
    Function: service.running
      Result: False
     Comment: The following requisites were not found:
                                 watch:
                                     file: salt-master-macos
     Started: 07:05:20.357944
    Duration: 0.008 ms
     Changes:   
----------
          ID: remove-old-master-conf-file
    Function: file.absent
        Name: /etc/salt/master.d/_defaults.conf
      Result: True
     Comment: File /etc/salt/master.d/_defaults.conf is not present
     Started: 07:05:20.357996
    Duration: 0.283 ms
     Changes:   

This appears to be a new condition, as I did not receive these errors yesterday.

Steps to reproduce the bug

1) Put pillars in place. 2) Attempt to run the salt.minion state on a minion. 3) See error.

Expected behaviour

I should not receive any errors when the formula attempts to manage the salt-minion or salt-master services.

Attempts to fix the bug

I have not attempted to fix the bug itself. I am able to prevent the behavior from occurring by switching my ref in my salt-master configuration to db8570609ce3a167a4759f03fec42ef2db28093d.

myii commented 4 years ago

Also mentioned by @ixs here: https://github.com/saltstack-formulas/salt-formula/pull/447#issuecomment-658738186.

@noelmcloughlin Do you have a fix for this? Or should the PR be reverted for the time being and then redone?

noelmcloughlin commented 4 years ago

I don't see the option to revert last PR so I'll see if I can raise a fix

noelmcloughlin commented 4 years ago

Apologies @prannonpendragas and @ixs I think Travis CI was already broken so I did not check Travis job.

I have raised a PR #477

myii commented 4 years ago

... I think Travis CI was already broken so I did not check Travis job.

Reference from Travis: https://travis-ci.com/github/saltstack-formulas/salt-formula/builds/171229128.

noelmcloughlin commented 4 years ago

Reference from Travis

Yes, I should have checked. Seems travis was working

myii commented 4 years ago

Thanks for the quick fix @noelmcloughlin. I'll let @ixs merge it if all is OK. Thanks for testing the fix @prannonpendragas.

saltstack-formulas-travis commented 4 years ago

:tada: This issue has been resolved in version 1.5.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: