Skip to content

Commit

Permalink
refactor(minion): use pkg.installed state for macOS
Browse files Browse the repository at this point in the history
Keep consistent with `salt/master.sls`.
  • Loading branch information
myii committed May 17, 2022
1 parent 8ab60b9 commit 3eff2d2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions salt/minion.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ download-salt-minion:
- macpackage: salt-minion
- retry: {{ salt_settings.retry_options | json }}
{%- elif "workaround https://github.com/saltstack/salt/issues/49348" %}
cmd.run:
- name: /usr/local/bin/brew install {{ salt_settings.salt_minion }}
- onlyif: test -x /usr/local/bin/brew
- runas: {{ salt_settings.rootuser }}
{% if salt_settings.install_packages %}
pkg.installed:
- name: {{ salt_settings.salt_minion }}
{%- if salt_settings.version is defined %}
- version: {{ salt_settings.version }}
{%- endif %}
{% endif %}
{%- endif %}
salt-minion-macos:
Expand Down Expand Up @@ -130,7 +133,7 @@ salt-minion:
{%- if grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source %}
- macpackage: salt-minion
{%- elif grains.os == 'MacOS' %}
- cmd: download-salt-minion
- pkg: download-salt-minion
{%- else %}
- pkg: salt-minion
{%- endif %}
Expand All @@ -155,7 +158,7 @@ restart-salt-minion:
{%- if grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source %}
- macpackage: salt-minion
{%- elif grains.os == 'MacOS' %}
- cmd: download-salt-minion
- pkg: download-salt-minion
{%- else %}
- pkg: salt-minion
{%- endif %}
Expand Down

0 comments on commit 3eff2d2

Please sign in to comment.