Skip to content

Commit

Permalink
Update nsclient with renovate
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy committed Nov 15, 2024
1 parent af94584 commit f2902bd
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions nsclient.sls
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
{%- load_yaml as versions %}
# renovate: datasource=github-releases depName=nscp packageName=mickem/nscp
- '0.5.3.4'
- '0.5.2.39'
- '0.5.2.29'
- '0.5.1.46'
- '0.5.1.45'
- '0.5.0.62'
- '0.4.4.23'
- '0.4.4.19'
- '0.4.3.143'
- '0.4.3.88'
{%- endload%}
# This is to handle the architecture
{%- if grains['cpuarch'] == 'AMD64' %}
{%- set arch_file = "x64" %}
{%- set arch_name = "x64" %}
{%- else %}
{%- set arch_file = "Win32" %}
{%- set arch_name = "x86" %}
{%- endif %}

nsclient:
{% for split_version in [
['0.5.3', '4'],
['0.5.2', '39'],
['0.5.2', '29'],
['0.5.1', '46'],
['0.5.1', '44'],
['0.5.0', '62'],
['0.4.4', '23'],
['0.4.4', '19'],
['0.4.3', '143'],
['0.4.3', '88']
] %}
{%- for version in versions %}
# This is to handle the version reported in Windows
{%- major, minor, maint, build = version.split(".") %}
{%- if minor >= 5 %} # version 5 and newer has 2 dots (0.5.2039)
{%- set install_version = ".".join([major, minor, maint]) %}
{%- set install_version = "0".join([install_version, build]) %}
{%- else %} # version 4 and lower has 3 dots (0.4.4.23)
{%- set install_version = version %}
{%- endif %}

{% if split_version[0][2] > '4' %} # versions prior to 0.5.xxxx had 3 dots
{% set version = "0".join(split_version) %}
{% else %}
{% set version = ".".join(split_version) %}
{% endif %}
{% set file_version = ".".join(split_version) %}
'{{ version }}':
{% if grains['cpuarch'] == 'AMD64' %}
full_name: 'NSClient++ (x64)'
installer: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-x64.msi'
uninstaller: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-x64.msi'
{% else %}
full_name: 'NSClient++ (x86)'
installer: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-Win32.msi'
uninstaller: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-Win32.msi'
{% endif %}
'{{ install_version }}':
full_name: 'NSClient++ ({{ arch_name }})'
installer: 'https://github.com/mickem/nscp/releases/download/{{ version }}/NSCP-{{ version }}-{{ arch_file }}.msi'
uninstaller: 'https://github.com/mickem/nscp/releases/download/{{ version }}/NSCP-{{ version }}-{{ arch_file }}.msi'
install_flags: '/quiet'
uninstall_flags: '/quiet'
msiexec: True
locale: en_US
reboot: False
{% endfor %}

{%- endfor %}

0 comments on commit f2902bd

Please sign in to comment.