Question: since this is actually installed and shown in Programs on Windows, what causing this failure state? If my next states would be dependent on successful state result for this state, I would not be able to progress further.
I assume this is something due to fact that this .NET exe actually installs Developer Pack and SDK?
I appreciate your time on this!!
dotnet:Windows package description file:
{%- if grains['kernel'] == 'Windows' %}
{%- set dotnet = salt['pillar.get']('microsoft:dotnet') %}
{%- set filename = dotnet.pkg ~ '-x86-x64-AllOS-ENU.exe' %}
{%- set source = salt['pillar.get']('SOURCE_LOCATION_THIRD_PARTY') ~ '/dotNet/' ~ filename ~ salt['pillar.get']('SOURCE_ENV', '') %}
{%- set target = salt['pillar.get']('DEPLOYMENT_PATH') ~ '/store/' ~ filename %}
{%- if salt['grains.get']('dotnetversion') < dotnet.inst_ver %}
file.managed:
- name: {{ target }}
- makedirs: True
- source: {{ source }}
- source_hash: 'sha256={{ dotnet.sha256 }}'
- retry:
attempts: 10
interval: 10
splay: 5
module.run:
- pkg.install:
- name: dotnet
- version: {{ dotnet.inst_ver }}
- saltenv: {{ saltenv }}
- refresh: True
- require:
- file: dotnet
{%- else %}
test.succeed_without_changes
{%- endif %}
{%- else %}
test.succeed_without_changes
{%- endif %}
dotnet:
{% for version, inst_ver, pkg in [
('4.5.2', '4.5.51209', 'NDP452-KB2901907'),
('4.6.2', '4.6.01590', 'NDP462-KB3151800'),
('4.7', '4.7.02053', 'NDP47-KB3186497'),
('4.7.2', '4.7.03062', 'NDP472-KB4054530'),
] %}
{% set installer = salt['pillar.get']('DEPLOYMENT_PATH') ~ '/store/' ~ pkg ~ '-x86-x64-AllOS-ENU.exe' %}
'{{ inst_ver }}':
full_name: 'Microsoft .NET Framework {{ version }}'
installer: {{ installer }}
install_flags: '/q /norestart'
uninstaller: 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SetupCache\v{{ inst_ver }}\Setup.exe'
uninstall_flags: '/uninstall /x86 /x64 /q /norestart'
msiexec: False
locale: en_US
reboot: False
{% endfor %}
microsoft:HTH...
dotnet:
inst_ver: 4.7.03062
pkg: NDP472-KB4054530
sha256: c908f0a5bea4be282e35acba307d0061b71b8b66ca9894943d3cbb53cad019bc
version: 4.7.2
-- Dirk Heinrichs <dirk.he...@altum.de> Matrix-Adresse: @heini:altum.de GPG Public Key: 80F1540E03A3968F3D79C382853C32C427B48049 Privacy Handbuch: https://www.privacy-handbuch.de
This is something we see for several packages on Windows. Our workaround is to use module.run instead. Here is our SLS for installing .Net:
...
!/usr/bin/env python
import logging
from is_salt_master import _is_salt_master
try:
# On newer versions
from salt.utils.platform import is_windows
except Exception:
# On older versions
from salt.utils import is_windows
log = logging.getLogger(__name__)
def __virtual__():
'''
Only valid on minions
'''
return not _is_salt_master()
def dotnetversion():
result = {}
result['dotnetversion'] = 'None'
try:
if is_windows():
# _winreg was renamed to winreg in P3
try:
import winreg
except ImportError:
import _winreg as winreg
key = winreg.OpenKey(
winreg.HKEY_LOCAL_MACHINE,
r'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full')
dotnetversion = winreg.QueryValueEx(key, "Version")[0]
log.info("Setting dotnetversion to '{}'".format(dotnetversion))
result['dotnetversion'] = dotnetversion
except ValueError as e:
log.exception(e)
finally:
return result
if __name__ == "__main__":
print(dotnetversion())
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/4c2d8612-198d-3431-4801-f06cd7f597c7%40altum.de.