revert instantiating a Caller Client in the engine

This Caller client prevents running the salt master as a non root user.  Also,
master processes are not assigned pillars so it is using whatever minion get
instantiated on the master from a caller client.

Instead, to use pillars, the engine should be started on in a minion process.
This commit is contained in:
Daniel Wallace 2018-05-01 09:42:57 -05:00
parent c267e6083e
commit ee8a5eeb10
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48
2 changed files with 18 additions and 4 deletions

View file

@ -3,3 +3,12 @@ Salt 2018.3.1 Release Notes
===========================
Version 2018.3.1 is a bugfix release for :ref:`2018.3.0 <release-2018-3-0>`.
Changes to Slack Engine pillars
-------------------------------
When using ``groups_pillar_name`` for the slack engine, the engine should be
used as part of a salt-minion process running on the master. This will allow
the minion to have pillars assigned to it, and will still allow the engine to
create a LocalClient connection to the master ipc sockets to control
environments.

View file

@ -88,6 +88,13 @@ In addition, other groups are being loaded from pillars.
:depends: slackclient
.. note:: groups_pillar_name
In order to use this, the engine must be running as of a minion running on
the master, so that the ``Caller`` client can be used to retrieve that
minions pillar data, because the master process does not have pillars.
'''
# Import python libraries
@ -237,10 +244,8 @@ class SlackClient(object):
XXX: instead of using Caller, make the minion to use configurable so there could be some
restrictions placed on what pillars can be used.
'''
if pillar_name:
caller = salt.client.Caller()
pillar_groups = caller.cmd('pillar.get', pillar_name)
# pillar_groups = __salt__['pillar.get'](pillar_name, {})
if pillar_name and __opts__['__role'] == 'minion':
pillar_groups = __salt__['pillar.get'](pillar_name, {})
log.debug('Got pillar groups %s from pillar %s', pillar_groups, pillar_name)
log.debug('pillar groups is %s', pillar_groups)
log.debug('pillar groups type is %s', type(pillar_groups))