2
0

Merge pull request #486 from noelmcloughlin/win

fix(windows): various fixes
This commit is contained in:
Imran Iqbal 2020-09-20 13:48:27 +01:00 committed by GitHub
commit 57d9e8b235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 10 deletions

View File

@ -11,6 +11,7 @@ salt:
use_pip: false use_pip: false
clean_config_d_dir: true clean_config_d_dir: true
restart_via_at: false restart_via_at: false
parallel: true # salt.git module argument
config_path: /etc/salt config_path: /etc/salt

View File

@ -34,13 +34,15 @@
{%- do processed_basedirs.append(basedir) %} {%- do processed_basedirs.append(basedir) %}
{{ basedir }}: {{ basedir }}:
file.directory: file.directory:
- parallel: {{ grains['saltversioninfo'] >= [2017, 7, 0] }} - parallel: {{ salt_settings.parallel }}
{%- for key, value in salt['pillar.get']('salt_formulas:basedir_opts', {%- for key, value in salt['pillar.get']('salt_formulas:basedir_opts',
{'makedirs': True}).items() %} {'makedirs': True}).items() %}
- {{ key }}: {{ value }} - {{ key }}: {{ value }}
- user: {{ salt_settings.rootuser }}
- group: {{ salt_settings.rootgroup }}
{%- endfor %} {%- endfor %}
- user: {{ salt_settings.rootuser }}
{%- if grains.kernel != 'Windows' %}
- group: {{ salt_settings.rootgroup }}
{%- endif %}
{%- endif %} {%- endif %}
# Setup the formula Git repository # Setup the formula Git repository
@ -54,7 +56,7 @@
{{ gitdir_env }}: {{ gitdir_env }}:
git.latest: git.latest:
- name: {{ baseurl }}/{{ f_name }}.git - name: {{ baseurl }}/{{ f_name }}.git
- parallel: {{ grains['saltversioninfo'] >= [2017, 7, 0] }} - parallel: {{ salt_settings.parallel }}
- target: {{ gitdir }} - target: {{ gitdir }}
{%- for key, value in options.items() %} {%- for key, value in options.items() %}
- {{ key }}: {{ value }} - {{ key }}: {{ value }}

View File

@ -6,7 +6,7 @@ include:
{%- if salt.config.get('salt_formulas:list') %} {%- if salt.config.get('salt_formulas:list') %}
- salt.formulas - salt.formulas
{%- endif %} {%- endif %}
{%- if salt.config.get('salt:master')|length > 1 %} {%- if salt.config.get('salt:master')|length > 1 and grains.kernel != 'Windows' %}
- salt.master - salt.master
{%- endif %} {%- endif %}
{%- if salt.config.get('salt:cloud')|length > 1 %} {%- if salt.config.get('salt:cloud')|length > 1 %}

View File

@ -7,6 +7,8 @@ include:
- .pin - .pin
{% endif %} {% endif %}
{%- if grains.kernel != 'Windows' %}
{%- if grains.os == 'MacOS' %} {%- if grains.os == 'MacOS' %}
salt-master-macos: salt-master-macos:
file.managed: file.managed:
@ -75,3 +77,12 @@ remove-default-master-conf-file:
remove-old-master-conf-file: remove-old-master-conf-file:
file.absent: file.absent:
- name: {{ salt_settings.config_path }}/master.d/_defaults.conf - name: {{ salt_settings.config_path }}/master.d/_defaults.conf
{%- else %}
salt-master-install-skip:
test.show_notification:
- text: |
No salt-master state for Windows
{%- endif %}

View File

@ -15,11 +15,14 @@
{%- set suse_testing_repo = ':/products:/next:/testing' if [osfamily_lower, osrelease] == ['suse', '15.2'] else '' %} {%- set suse_testing_repo = ':/products:/next:/testing' if [osfamily_lower, osrelease] == ['suse', '15.2'] else '' %}
#from template-formula #from template-formula
{%- if grains.os == 'MacOS' %} {%- if grains.os_family == 'MacOS' %}
{%- set macos_rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %} {%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %}
{%- set macos_rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} {%- set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
{%- elif grains.os_family == 'Windows' %}
{%- set rootuser = salt['cmd.run']("id -un") %}
{%- endif %} {%- endif %}
Debian: Debian:
pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main' pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
key_url: 'https://repo.saltstack.com/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' key_url: 'https://repo.saltstack.com/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
@ -130,6 +133,7 @@ Windows:
salt_minion: salt-minion{{ '-' ~ py_ver_repr if py_ver_repr else '' }} salt_minion: salt-minion{{ '-' ~ py_ver_repr if py_ver_repr else '' }}
config_path: 'C:\salt\conf' config_path: 'C:\salt\conf'
minion_service: salt-minion minion_service: salt-minion
rootuser: {{ rootuser | d('') }}
MacOS: MacOS:
salt_minion: salt salt_minion: salt
@ -138,5 +142,5 @@ MacOS:
config_path: /private/etc/salt config_path: /private/etc/salt
minion_service: com.saltstack.salt.minion minion_service: com.saltstack.salt.minion
## from template-formula ## from template-formula
rootuser: {{ macos_rootuser | d('') }} rootuser: {{ rootuser | d('') }}
rootgroup: {{ macos_rootgroup | d('') }} rootgroup: {{ rootgroup | d('') }}

View File

@ -61,3 +61,6 @@ MacOS:
master_service: com.saltstack.salt.master master_service: com.saltstack.salt.master
salt_master_macos_plist_hash: 8435331b2d48ca8f0759f216e5b15ec9171a4216b1441328c732c6906728b7c9 salt_master_macos_plist_hash: 8435331b2d48ca8f0759f216e5b15ec9171a4216b1441328c732c6906728b7c9
salt_minion_macos_plist_hash: 26b33da12e0d8960ee96b488c8352002c22a377c19bf3df3f986a1e49eca8b20 salt_minion_macos_plist_hash: 26b33da12e0d8960ee96b488c8352002c22a377c19bf3df3f986a1e49eca8b20
Windows:
parallel: false # not supported on windows/cygwin