Skip to content
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

Make the Salt Proxy environment aware #55932

Conversation

@bdrung
Copy link
Contributor

bdrung commented Jan 22, 2020

The Salt proxy minion is looking for proxy minion modules in
salt://_proxy/. It does so however only in the default "base"
environment. On setups which do not use "base" or shall be executed in a
different environment this breaks:

/etc/salt/master:
...
file_roots:
noc:
- /srv/salt
...

$ grep "proxyenabled" /srv/salt/_proxy/junos_manager.py
proxyenabled = ['junos_manager']

$ salt-proxy --proxyid=dev1 -l debug
...
[DEBUG ] rest_sample proxy virtual() called...
[INFO ] ssh_sample proxy virtual() called...
[DEBUG ] Could not LazyLoad junos_manager.grains
[DEBUG ] Could not LazyLoad junos_manager.init
[ERROR ] Proxymodule junos_manager is missing an init() or a
shutdown() or both. Check your proxymodule. Salt-proxy aborted.
[WARNING ] Stopping the Salt Proxy Minion
[ERROR ] -1
[INFO ] The proxy minion is shutting down..
[INFO ] The Salt ProxyMinion is shut down

This is because the loader only looks for _proxy modules in the "base"
environment. This commit fixes this (but might possibly break other
things, though I did not find side-effects)

The initial pull request #36704 were merged quite some time ago, but one part of it is missing in the 2019.2 release (again?).

@bdrung bdrung requested a review from saltstack/team-core as a code owner Jan 22, 2020
@pull-assigner pull-assigner bot requested a review from Ch3LL Jan 22, 2020
The Salt proxy minion is looking for proxy minion modules in
salt://_proxy/. It does so however only in the default "base"
environment. On setups which do not use "base" or shall be executed in a
different environment this breaks:

/etc/salt/master:
...
file_roots:
  noc:
    - /srv/salt
...

$ grep "proxyenabled" /srv/salt/_proxy/junos_manager.py
__proxyenabled__ = ['junos_manager']

$ salt-proxy --proxyid=dev1 -l debug
...
[DEBUG   ] rest_sample proxy __virtual__() called...
[INFO    ] ssh_sample proxy __virtual__() called...
[DEBUG   ] Could not LazyLoad junos_manager.grains
[DEBUG   ] Could not LazyLoad junos_manager.init
[ERROR   ] Proxymodule junos_manager is missing an init() or a
shutdown() or both. Check your proxymodule.  Salt-proxy aborted.
[WARNING ] Stopping the Salt Proxy Minion
[ERROR   ] -1
[INFO    ] The proxy minion is shutting down..
[INFO    ] The Salt ProxyMinion is shut down

This is because the loader only looks for _proxy modules in the "base"
environment. This commit fixes this (but might possibly break other
things, though I did not find side-effects)

Initial pull request: #36704
Forwarded: #55932
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
@bdrung bdrung force-pushed the bdrung:2019.2-make-salt-proxy-environment-aware branch from a7631bd to 4ec3ec5 Jan 22, 2020
bdrung added a commit to bdrung/salt that referenced this pull request Jan 24, 2020
The Salt proxy minion is looking for proxy minion modules in
salt://_proxy/. It does so however only in the default "base"
environment. On setups which do not use "base" or shall be executed in a
different environment this breaks:

/etc/salt/master:
...
file_roots:
  noc:
    - /srv/salt
...

$ grep "proxyenabled" /srv/salt/_proxy/junos_manager.py
__proxyenabled__ = ['junos_manager']

$ salt-proxy --proxyid=dev1 -l debug
...
[DEBUG   ] rest_sample proxy __virtual__() called...
[INFO    ] ssh_sample proxy __virtual__() called...
[DEBUG   ] Could not LazyLoad junos_manager.grains
[DEBUG   ] Could not LazyLoad junos_manager.init
[ERROR   ] Proxymodule junos_manager is missing an init() or a
shutdown() or both. Check your proxymodule.  Salt-proxy aborted.
[WARNING ] Stopping the Salt Proxy Minion
[ERROR   ] -1
[INFO    ] The proxy minion is shutting down..
[INFO    ] The Salt ProxyMinion is shut down

This is because the loader only looks for _proxy modules in the "base"
environment. This commit fixes this (but might possibly break other
things, though I did not find side-effects)

Initial pull request: saltstack#36704
Forwarded: saltstack#55932
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
bdrung added a commit to bdrung/salt that referenced this pull request Feb 21, 2020
The Salt proxy minion is looking for proxy minion modules in
`salt://_proxy/`. It does so however only in the default `base`
environment. On setups which do not use `base` or shall be executed in a
different environment this breaks:

/etc/salt/master:
```
...
file_roots:
  noc:
    - /srv/salt
...
```

```
$ grep "proxyenabled" /srv/salt/_proxy/junos_manager.py
__proxyenabled__ = ['junos_manager']

$ salt-proxy --proxyid=dev1 -l debug
...
[DEBUG   ] rest_sample proxy __virtual__() called...
[INFO    ] ssh_sample proxy __virtual__() called...
[DEBUG   ] Could not LazyLoad junos_manager.grains
[DEBUG   ] Could not LazyLoad junos_manager.init
[ERROR   ] Proxymodule junos_manager is missing an init() or a
shutdown() or both. Check your proxymodule.  Salt-proxy aborted.
[WARNING ] Stopping the Salt Proxy Minion
[ERROR   ] -1
[INFO    ] The proxy minion is shutting down..
[INFO    ] The Salt ProxyMinion is shut down
```

This is because the loader only looks for _proxy modules in the `base`
environment. This commit fixes this (but might possibly break other
things, though I did not find side-effects).

Initial pull request: saltstack#36704
Forwarded: saltstack#55932
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
@bdrung

This comment has been minimized.

Copy link
Contributor Author

bdrung commented Feb 21, 2020

Rebased against the master branch and opened pull request #56222 for it. So closing this one.

@bdrung bdrung closed this Feb 21, 2020
@bdrung bdrung deleted the bdrung:2019.2-make-salt-proxy-environment-aware branch Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.