From e94f15d0fe02d6164240bf076e0fa4f3e053793c Mon Sep 17 00:00:00 2001 From: Tibold Date: Tue, 15 Aug 2017 20:48:15 +0000 Subject: [PATCH] Added support for installing pynotify when inotify beacons are configuredwq --- pillar.example | 1 + salt/map.jinja | 1 + salt/minion.sls | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/pillar.example b/pillar.example index 6ddce21..f549219 100644 --- a/pillar.example +++ b/pillar.example @@ -21,6 +21,7 @@ salt: salt-syndic: 'salt-syndic' salt-cloud: 'salt-cloud' salt-ssh: 'salt-ssh' + pyinotify: 'python-pyinotify' the package to be installed for pyinotify # Set which release of SaltStack to use, default to 'latest' # To get the available releases: diff --git a/salt/map.jinja b/salt/map.jinja index de18a39..3847b71 100644 --- a/salt/map.jinja +++ b/salt/map.jinja @@ -47,6 +47,7 @@ that differ from whats in defaults.yaml salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease)|string + '/amd64/' + salt_release + ' ' + salt['grains.get']('oscodename') + ' main', 'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease)|string + '/amd64/' + salt_release + '/SALTSTACK-GPG-KEY.pub', 'libgit2': 'libgit2-22', + 'pyinotify': 'python-pyinotify', 'gitfs': { 'pygit2': { 'install_from_source': True, diff --git a/salt/minion.sls b/salt/minion.sls index c440228..4cdf060 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -63,6 +63,16 @@ restart-salt-minion: - file: remove-old-minion-conf-file {%- endif %} +{% if 'inotify' in salt_settings.get('minion', {}).get('beacons', {}) and salt_settings.get('pyinotify', False) %} +salt-minion-beacon-inotify: + pkg.installed: + - name: {{ salt_settings.pyinotify }} + - require_in: + - service: salt-minion + - watch_in: + - service: salt-minion +{% endif %} + {% if salt_settings.minion_remove_config %} remove-default-minion-conf-file: file.absent: