-
Notifications
You must be signed in to change notification settings - Fork 0
/
ActivateCatalog.yml
55 lines (55 loc) · 2.09 KB
/
ActivateCatalog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
# Ansible playbook to run Windows Update and restart, if required
#
# http://docs.ansible.com/ansible/win_updates_module.html
# https://docs.ansible.com/ansible/win_reboot_module.html
#- hosts: all
# tasks:
- set_fact:
catalogName: "{{catalog_url.split('/')[-1]}}"
when: catalogName is not defined
- name: Download catalog from specified URL
win_get_url:
url: "{{catalog_url}}"
dest: c:\DatabaseBkup\
url_username: "{{url_username}}"
url_password: "{{url_password}}"
when: catalogName is not defined
- name: Obtain information about a file
win_stat:
path: C:\Program Files\Harmonic\NMX\DOTNETGUI\AnsibleActivateCatalog.exe
register: file_info
# - name: Download ActivateCatalog zip
# win_get_url:
# url: "https://[email protected]/projects/NMXGROUP/repos/nmx_playbooks/browse/nmx_playbooks/AnsibleActivateCatalog.exe"
# dest: C:\Program Files\Harmonic\NMX\DOTNETGUI\
# when: file_info.stat.exists==false
# - name: Unzip the Download ActivateCatalog zip
# win_unzip:
# src: c:\temp\master.zip
# dest: C:\temp\
# rm: True
# when: file_info.stat.exists==false
# - name: Find the Activate Catalog file
# win_find:
# paths: C:\Temp\AWX_CatalogActive-master
# patterns: ['*.exe']
# recurse: True
# register: resultFile
# when: file_info.stat.exists==false
# - name: Copy the Activate Catalog file
# win_copy:
# src: "{{resultFile.files[0].path}}"
# dest: C:\Program Files\Harmonic\NMX\DOTNETGUI\
# remote_src: yes
# when: file_info.stat.exists==false
# - name: Make catalog active
# win_package:
# path: C:\Program Files\Harmonic\NMX\DOTNETGUI\AnsibleActivateCatalog.exe
# product_id: ConsoleApp
# arguments: /{{catalogName.split('.')[0]}} /{{sqlServername}} /{{sqlPassword}} /{{ansible_host}}
# when: catalogName is defined
# - name: Delete the Active Catalog folder
# win_file:
# path: C:\Temp\AWX_CatalogActive-master
# state: absent