diff --git a/kubernetes/client/aliases/install.sls b/kubernetes/client/aliases/install.sls index b2cf0595..c4b3878b 100644 --- a/kubernetes/client/aliases/install.sls +++ b/kubernetes/client/aliases/install.sls @@ -20,9 +20,11 @@ include: ) }} - mode: '0640' + - makedirs: True + {%- if grains.os != 'Windows' %} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - - makedirs: True + {%- endif %} - template: jinja - require: - sls: {{ sls_archive_install if d.client.pkg.use_upstream == 'archive' else sls_binary_install if d.client.pkg.use_upstream == 'binary' else sls_package_install }} # noqa 204 diff --git a/kubernetes/client/archive/clean.sls b/kubernetes/client/archive/clean.sls index 086e5640..4fec3c5a 100644 --- a/kubernetes/client/archive/clean.sls +++ b/kubernetes/client/archive/clean.sls @@ -14,7 +14,7 @@ include: - names: - {{ d.dir.tmp }}/client* - {{ d.client.pkg.path }}/bin - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in d.client.pkg.commands|unique %} - /usr/local/bin/{{ cmd }} {%- endfor %} diff --git a/kubernetes/client/archive/install.sls b/kubernetes/client/archive/install.sls index bbadf3b7..da9eee77 100644 --- a/kubernetes/client/archive/install.sls +++ b/kubernetes/client/archive/install.sls @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vim: ft=sls -{%- if grains.kernel|lower in ('linux', 'darwin') %} +{%- if grains.kernel|lower in ('linux', 'darwin', 'windows') %} {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} {%- set formula = d.formula %} @@ -9,37 +9,43 @@ {%- if d.client.pkg.use_upstream == 'archive' and 'pkg' in d.client and 'archive' in d.client['pkg'] %} {{ formula }}-client-archive-install: + {%- if grains.os != 'Windows' %} pkg.installed: - names: {{ d.pkg.deps|json }} - require_in: - file: {{ formula }}-client-archive-install + {%- endif %} file.directory: - name: {{ d.client.pkg.path }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - makedirs: True - clean: True - require_in: - archive: {{ formula }}-client-archive-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} archive.extracted: {{- format_kwargs(d.client['pkg']['archive']) }} - retry: {{ d.retry_option|json }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - enforce_toplevel: false - trim_output: true + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group + {%- endif %} - require: - file: {{ formula }}-client-archive-install - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in d.client.pkg.commands|unique %} {{ formula }}-client-archive-install-symlink-{{ cmd }}: diff --git a/kubernetes/client/binary/install.sls b/kubernetes/client/binary/install.sls index fae42440..25e0c0b0 100644 --- a/kubernetes/client/binary/install.sls +++ b/kubernetes/client/binary/install.sls @@ -5,7 +5,7 @@ {%- from tplroot ~ "/map.jinja" import data as d with context %} {%- set formula = d.formula %} - {%- if d.client.pkg.use_upstream == 'binary' %} + {%- if d.client.pkg.use_upstream == 'binary' and grains.os != 'Windows' %} {{ formula }}-client-binary-install: pkg.installed: @@ -14,12 +14,12 @@ - file: {{ formula }}-client-binary-install file.directory: - name: {{ d.client.pkg.path }}/bin - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - makedirs: True - require_in: - cmd: {{ formula }}-client-binary-install + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group @@ -31,14 +31,14 @@ - retry: {{ d.retry_option|json }} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - {%- if 'source_hash' in d.client.pkg.binary and d.client.pkg.binary.source_hash %} + {%- if 'source_hash' in d.client.pkg.binary and d.client.pkg.binary.source_hash %} module.run: - name: file.check_hash - path: {{ d.client.pkg.path }}/bin/kubectl - file_hash: {{ d.client.pkg.binary.source_hash }} - require: - cmd: {{ formula }}-client-binary-install - {%- endif %} + {%- endif %} {{ formula }}-client-binary-install-symlink: file.symlink: diff --git a/kubernetes/devlibs/archive/install.sls b/kubernetes/devlibs/archive/install.sls index b9d2aeea..73cf1568 100644 --- a/kubernetes/devlibs/archive/install.sls +++ b/kubernetes/devlibs/archive/install.sls @@ -14,28 +14,33 @@ {{ formula }}-devlibs-archive-{{ tool }}-install: file.directory: - - name: {{ p['path'] }}/ - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} + - name: {{ p['path'] }} - mode: 755 - clean: True - makedirs: True - require_in: - archive: {{ formula }}-devlibs-archive-{{ tool }}-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} archive.extracted: {{- format_kwargs(p['archive']) }} - retry: {{ d.retry_option }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - enforce_toplevel: false - trim_output: true + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group + - mode + {%- endif %} {% endif %} {% endif %} diff --git a/kubernetes/devtools/archive/install.sls b/kubernetes/devtools/archive/install.sls index 312ee13b..885b119d 100644 --- a/kubernetes/devtools/archive/install.sls +++ b/kubernetes/devtools/archive/install.sls @@ -14,30 +14,34 @@ {{ formula }}-devtools-archive-{{ tool }}-install: file.directory: - - name: {{ d.devtools['pkg'][tool]['path'] }}/ - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} + - name: {{ d.devtools['pkg'][tool]['path'] }} - mode: 755 - clean: True - makedirs: True - require_in: - archive: {{ formula }}-devtools-archive-{{ tool }}-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} archive.extracted: {{- format_kwargs(d.devtools['pkg'][tool]['archive']) }} - retry: {{ d.retry_option }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - enforce_toplevel: false - trim_output: true + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} - {%- for cmd in d.devtools['pkg'][tool]['commands']|unique %} + {%- endif %} + {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} + {%- for cmd in d.devtools['pkg'][tool]['commands']|unique %} {{ formula }}-devtools-archive-{{ tool }}-install-symlink-{{ cmd }}: file.symlink: @@ -48,10 +52,10 @@ - require: - archive: {{ formula }}-devtools-archive-{{ tool }}-install - {% endfor %} - {% endif %} + {% endfor %} + {% endif %} - {% endif %} + {% endif %} {% endif %} {%- endfor %} {%- endif %} diff --git a/kubernetes/devtools/binary/install.sls b/kubernetes/devtools/binary/install.sls index 48fa5b69..d5725a74 100644 --- a/kubernetes/devtools/binary/install.sls +++ b/kubernetes/devtools/binary/install.sls @@ -14,23 +14,27 @@ {{ formula }}-devtools-binary-{{ tool }}-install: file.directory: - name: {{ p[tool]['path'] }}/bin - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - makedirs: True - require_in: - cmd: {{ formula }}-devtools-binary-{{ tool }}-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} cmd.run: - names: - curl -Lo {{ p[tool]['path'] }}/bin/{{ tool }} {{ p[tool]['binary']['source'] }} - chmod '0755' {{ p[tool]['path'] }}/bin/{{ tool }} 2>/dev/null - retry: {{ d.retry_option|json }} + {%- if grains.os != 'Windows' %} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} + {%- endif %} {%- if 'source_hash' in p[tool]['binary'] and p[tool]['binary']['source_hash'] %} module.run: - name: file.check_hash @@ -40,7 +44,7 @@ - cmd: {{ formula }}-devtools-binary-{{ tool }}-install {%- endif %} - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grain.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in p[tool]['commands']|unique %} {{ formula }}-devtools-binary-{{ tool }}-install-symlink-{{ cmd }}: file.symlink: diff --git a/kubernetes/k3s/binary/install.sls b/kubernetes/k3s/binary/install.sls index 74055ad7..94798f21 100644 --- a/kubernetes/k3s/binary/install.sls +++ b/kubernetes/k3s/binary/install.sls @@ -12,14 +12,16 @@ - names: {{ d.pkg.deps|json }} file.directory: - name: {{ d.k3s.pkg.path }}/bin - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - makedirs: True + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} - require: - pkg: {{ formula }}-k3s-binary-prerequisites @@ -28,15 +30,18 @@ - name: {{ d.k3s.pkg.path }}/bin/k3s - source: {{ d.k3s.pkg.binary.source }} - source_hash: {{ d.k3s.pkg.binary.source_hash }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - retry: {{ d.retry_option|json }} - require: - file: {{ formula }}-k3s-binary-prerequisites + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} + {%- endif %} {{ formula }}-k3s-binary-install-symlink: file.symlink: + - unless: {{ grains.os == 'Windows' }} - name: /usr/local/bin/k3s - target: {{ d.k3s.pkg.path }}/bin/k3s - force: True diff --git a/kubernetes/k3s/config/file.sls b/kubernetes/k3s/config/file.sls index 26cacc7d..330c6ee4 100644 --- a/kubernetes/k3s/config/file.sls +++ b/kubernetes/k3s/config/file.sls @@ -22,12 +22,14 @@ include: ) }} - mode: 644 + - makedirs: True + {%- if grains.os != 'Windows' %} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - - makedirs: True + {%- endif %} - template: jinja - context: - config: {{ d.k3s.config|json }} + config: {{ d.k3s.config|json }} - require: - sls: {{ sls_archive_install if d.k3s.pkg.use_upstream == 'archive' else sls_binary_install if d.k3s.pkg.use_upstream == 'binary' else sls_package_install }} # noqa 204 diff --git a/kubernetes/k3s/script/install.sls b/kubernetes/k3s/script/install.sls index 865f759c..9640b9b5 100644 --- a/kubernetes/k3s/script/install.sls +++ b/kubernetes/k3s/script/install.sls @@ -21,25 +21,28 @@ - file: {{ formula }}-k3s-script-install-prerequisites {%- endif %} file.directory: - - names: - - {{ d.dir.tmp }} - - user: root - - group: {{ d.identity.rootgroup }} + - name: {{ d.dir.tmp }} - mode: '0755' - makedirs: True - require: - pkg: {{ formula }}-k3s-script-install-prerequisites + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} + {%- endif %} {{ formula }}-k3s-script-download: file.managed: - name: {{ d.dir.tmp }}/k3s-bootstrap.sh - source: {{ d.k3s.pkg.script.source }} - source_hash: {{ d.k3s.pkg.script.source_hash }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - require: - file: {{ formula }}-k3s-script-install-prerequisites + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} + {%- endif %} {{ formula }}-k3s-script-download-clean: file.absent: diff --git a/kubernetes/node/archive/clean.sls b/kubernetes/node/archive/clean.sls index db83f960..7a90ed26 100644 --- a/kubernetes/node/archive/clean.sls +++ b/kubernetes/node/archive/clean.sls @@ -14,7 +14,7 @@ include: - names: - {{ d.dir.tmp }}/kubernetes-node* - {{ d.node.pkg.path }}/bin - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grain.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in d.node.pkg.commands|unique %} - /usr/local/bin/{{ cmd }} {%- endfor %} diff --git a/kubernetes/node/archive/install.sls b/kubernetes/node/archive/install.sls index a2b905d3..ba2d32d3 100644 --- a/kubernetes/node/archive/install.sls +++ b/kubernetes/node/archive/install.sls @@ -9,37 +9,43 @@ {%- if d.node.pkg.use_upstream == 'archive' and 'archive' in d.node.pkg %} {{ formula }}-node-archive-install: + {%- if grains.os != 'Windows' %} pkg.installed: - names: {{ d.pkg.deps|json }} - require_in: - file: {{ formula }}-node-archive-install + {%- endif %} file.directory: - name: {{ d.node.pkg.path }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - makedirs: True - clean: True - require_in: - archive: {{ formula }}-node-archive-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} archive.extracted: {{- format_kwargs(d.node['pkg']['archive']) }} - retry: {{ d.retry_option|json }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - enforce_toplevel: false - trim_output: true + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group + {%- endif %} - require: - file: {{ formula }}-node-archive-install - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in d.node.pkg.commands|unique %} {{ formula }}-node-archive-install-symlink-{{ cmd }}: diff --git a/kubernetes/node/config/environ.sls b/kubernetes/node/config/environ.sls index 5da7d029..43944e19 100644 --- a/kubernetes/node/config/environ.sls +++ b/kubernetes/node/config/environ.sls @@ -20,12 +20,14 @@ include: ) }} - mode: '0640' - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - makedirs: True - template: jinja + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} + {%- endif %} - context: - environ: {{ d.node.environ|json }} + environ: {{ d.node.environ|json }} - require: - sls: {{ sls_archive_install if d.node.pkg.use_upstream == 'archive' else sls_package_install }} diff --git a/kubernetes/node/config/file.sls b/kubernetes/node/config/file.sls index 66cd5aac..4d9d682e 100644 --- a/kubernetes/node/config/file.sls +++ b/kubernetes/node/config/file.sls @@ -20,9 +20,11 @@ include: ) }} - mode: 644 + - makedirs: True + {%- if grains.os != 'Windows' %} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - - makedirs: True + {%- endif %} - template: jinja - context: config: {{ d.node.config|json }} diff --git a/kubernetes/operators/archive/install.sls b/kubernetes/operators/archive/install.sls index e51e6f4a..1e3eaf1d 100644 --- a/kubernetes/operators/archive/install.sls +++ b/kubernetes/operators/archive/install.sls @@ -17,9 +17,7 @@ {{ formula }}-operators-archive-{{ tool }}-install: file.directory: - - name: {{ d.operators.pkg[tool]['path'] }}/ - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} + - name: {{ d.operators.pkg[tool]['path'] }} - mode: 755 - clean: True - makedirs: True @@ -27,20 +25,26 @@ - pkg: {{ formula }}-operators-archive-deps-install - require_in: - archive: {{ formula }}-operators-archive-{{ tool }}-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} archive.extracted: {{- format_kwargs(d.operators.pkg[tool]['archive']) }} - retry: {{ d.retry_option }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - enforce_toplevel: false - trim_output: true + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group + {%- endif %} {% endif %} {% endif %} diff --git a/kubernetes/server/archive/clean.sls b/kubernetes/server/archive/clean.sls index b0b62532..5f4c0112 100644 --- a/kubernetes/server/archive/clean.sls +++ b/kubernetes/server/archive/clean.sls @@ -14,7 +14,7 @@ include: - names: - {{ d.dir.tmp }}/kubernetes-server* - {{ d.server.pkg.path }}/bin - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in d.server.pkg.commands|unique %} - /usr/local/bin/{{ cmd }} {%- endfor %} diff --git a/kubernetes/server/archive/install.sls b/kubernetes/server/archive/install.sls index f2456de9..fe83a5f0 100644 --- a/kubernetes/server/archive/install.sls +++ b/kubernetes/server/archive/install.sls @@ -9,37 +9,43 @@ {%- if d.server.pkg['use_upstream'] == 'archive' and 'archive' in d.server.pkg %} {{ formula }}-server-archive-install: + {%- if grains.os != 'Windows' %} pkg.installed: - names: {{ d.pkg.deps|json }} - require_in: - file: {{ formula }}-server-archive-install + {%- endif %} file.directory: - name: {{ d.server.pkg.path }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - makedirs: True - clean: True - require_in: - archive: {{ formula }}-server-archive-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} archive.extracted: {{- format_kwargs(d.server['pkg']['archive']) }} - retry: {{ d.retry_option|json }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - enforce_toplevel: false - trim_output: true + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group + {%- endif %} - require: - file: {{ formula }}-server-archive-install - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in d.server.pkg.commands|unique %} {{ formula }}-server-archive-install-symlink-{{ cmd }}: @@ -52,7 +58,6 @@ {%- endfor %} {%- endif %} - {%- endif %} {%- else %} diff --git a/kubernetes/server/config/environ.sls b/kubernetes/server/config/environ.sls index 840b6ea1..ce87398d 100644 --- a/kubernetes/server/config/environ.sls +++ b/kubernetes/server/config/environ.sls @@ -20,12 +20,14 @@ include: ) }} - mode: '0640' + - makedirs: True + {%- if grains.os != 'Windows' %} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - - makedirs: True + {%- endif %} - template: jinja - context: - environ: {{ d.server.environ|json }} + environ: {{ d.server.environ|json }} - require: - sls: {{ sls_archive_install if d.server.pkg.use_upstream == 'archive' else sls_package_install }} diff --git a/kubernetes/server/config/file.sls b/kubernetes/server/config/file.sls index b3ad1abd..ab065945 100644 --- a/kubernetes/server/config/file.sls +++ b/kubernetes/server/config/file.sls @@ -20,12 +20,14 @@ include: ) }} - mode: 644 + - makedirs: True + {%- if grains.os != 'Windows' %} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - - makedirs: True + {%- endif %} - template: jinja - context: - config: {{ d.server.config|json }} + config: {{ d.server.config|json }} - require: - sls: {{ sls_archive_install if d.server.pkg.use_upstream == 'archive' else sls_package_install }} diff --git a/kubernetes/sigs/archive/install.sls b/kubernetes/sigs/archive/install.sls index 9a79a24b..16764561 100644 --- a/kubernetes/sigs/archive/install.sls +++ b/kubernetes/sigs/archive/install.sls @@ -18,9 +18,7 @@ {{ formula }}-sigs-archive-{{ tool }}-install: file.directory: - - name: {{ p['path'] }}/ - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} + - name: {{ p['path'] }} - mode: 755 - clean: True - makedirs: True @@ -28,21 +26,27 @@ - pkg: {{ formula }}-sigs-archive-deps-install - require_in: - archive: {{ formula }}-sigs-archive-{{ tool }}-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} archive.extracted: {{- format_kwargs(p['archive']) }} - retry: {{ d.retry_option }} - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - enforce_toplevel: false - trim_output: true + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- endif %} + {%- if (d.linux.altpriority|int == 0 and grain.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in p['commands']|unique %} {{ formula }}-sigs-archive-{{ tool }}-install-symlink-{{ cmd }}: diff --git a/kubernetes/sigs/binary/install.sls b/kubernetes/sigs/binary/install.sls index 6d1fa496..111ee7e9 100644 --- a/kubernetes/sigs/binary/install.sls +++ b/kubernetes/sigs/binary/install.sls @@ -18,25 +18,29 @@ {{ formula }}-sigs-binary-{{ tool }}-install: file.directory: - name: {{ p['path'] }}/bin - - user: {{ d.identity.rootuser }} - - group: {{ d.identity.rootgroup }} - mode: 755 - makedirs: True - require: - pkg: {{ formula }}-sigs-binary-deps-install - require_in: - cmd: {{ formula }}-sigs-binary-{{ tool }}-install + {%- if grains.os != 'Windows' %} + - user: {{ d.identity.rootuser }} + - group: {{ d.identity.rootgroup }} - recurse: - user - group - mode + {%- endif %} cmd.run: - names: - curl -Lo {{ p['path'] }}/bin/{{ tool }} {{ p['binary']['source'] }} - chmod '0755' {{ p['path'] }}/bin/{{ tool }} 2>/dev/null - retry: {{ d.retry_option|json }} + {%- if grains.os != 'Windows' %} - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} + {%- endif %} {%- if 'source_hash' in p['binary'] and p['binary']['source_hash'] %} module.run: - name: file.check_hash @@ -46,7 +50,7 @@ - cmd: {{ formula }}-sigs-binary-{{ tool }}-install {%- endif %} - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if (d.linux.altpriority|int == 0 and grain.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %} {%- for cmd in p['commands']|unique %} {{ formula }}-sigs-binary-{{ tool }}-install-symlink-{{ cmd }}: