Skip to content

Update the nsclient download path as variable #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
---

#config setup section
nsclient_download_loc: 'https://github.com/mickem/nscp/releases/download/0.5.0.62'
nsclient_package_name: 'NSCP-0.5.0.62-x64.msi'
16 changes: 5 additions & 11 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
# tasks file for NSClient++
---

- name: Create setup folder
win_file:
path: C:\setup
state: directory

- name: Check for "NSClient++"
win_stat:
path: "c:\\setup\\NSCP-0.5.0.62-x64.msi"
path: "c:\\setup\\{{ nsclient_package_name }}"
register: msipackagestat

- name: Download "NSClient++"
win_get_url:
url: "https://github.com/mickem/nscp/releases/download/0.5.0.62/NSCP-0.5.0.62-x64.msi"
dest: "C:\\setup\\NSCP-0.5.0.62-x64.msi"
url: "{{ nsclient_download_loc }}/{{ nsclient_package_name }}"
dest: "C:\\setup\\{{ nsclient_package_name }}"
when: not msipackagestat.stat.exists

- name: Install "NSClient++"
win_msi:
path: "C:\\setup\\NSCP-0.5.0.62-x64.msi"
path: "C:\\setup\\{{ nsclient_package_name }}"
wait: True
when: not msipackagestat.stat.exists

- name: Update NSClient++ configuration
- name: Update NSCclient++ configuration
win_template:
src: programfiles/nsclient/nsclient.ini.j2
dest: "C:\\Program Files\\NSClient++\\nsclient.ini"
notify: restart nsclient
tags:
- configuration

- name: Restart NSClient++
win_service:
name: nscp
state: restarted