-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weird salt behaviour for highstate with contradicting state.funcs #46615
Comments
If I split use case into two separate highstates everything works. highstate1: |
Cannot replicate on Ubuntu. |
@noelmcloughlin Initial thought is that |
Thanks @garethgreenaway for the input. I was doing more alternatives testing this week on Centos/Fedora. The I'll look into this further over next few weeks when I get time. |
closing as stale issue. Will test again in future. |
Description of Issue/Question
Salt seems to get confused if highstate includes contradicting state.functions.
On #45510 I noted weird issue wrt
service.dead
andservice.running
in same highstate.Replicating
State
postgres.server.init
(service.running watching pkg.installed) works.State
postgres.server.remove
(service.dead watching pkg.removed) works.Include both states in same highstate breaks service.running:
Today a 2nd weird issue wrt to
alternatives.remove
andalternatives.installed
in same highstate.Replicating
State
postgres.server.remove.alternatives.remove
is True (initdb
symlink does not exist).State
postgres.server.init.pkg.installed
is True (upstream postgres-server installsinitdb
symlink).State
postgres.server.init.alternatives.install
is True (initdb
symlink already exists).State
postgres.cmd.run.initdb
is False (initdb
symlink is missing Huh???)Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
Both issues are related to #45510.
Both issues replicated when highstate invokes this code before standard
install
use cases execute in same highstate?Masterless minion.
...
postgresql-{{ bin }}-removed:
alternatives.remove:
- path: {{ path }}
- require:
- pkg: postgresql-server-removed
- onlyif: test -f {{ path }}
...
{{ bin }}:
alternatives.install:
- link: {{ salt['file.join']('/usr/bin', bin) }}
- path: {{ path }}
- priority: {{ postgres.linux.altpriority }}
- onlyif: test -f {{ path }}
...
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
Both issues happen if highstate includes postgres.server.remove and
postgres.server.init
states.(1) The high.state called
alternatives.remove
which works as expected (initdb not found).(2) Then high.state called
pkg.installed
which added upstream postgresql-server package. This package creates the initdb symlink during RPM post-installation.(3) Then high.state called
alternatives.install
which noticed the symlink was pre-existing.(4) Then highstate called 'cmd.run.name: initdb ..' but symlink is gone? Huh????
Versions Report
(Provided by running
salt --versions-report
. Please also mention any differences in master/minion versions.)The text was updated successfully, but these errors were encountered: