52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
---
|
|
- name: Send notification message via Slack
|
|
delegate_to: localhost
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: Copying Note_install files to {{ inventory_hostname }}
|
|
|
|
- name: Prepare install target
|
|
ansible.windows.win_file:
|
|
path: D:\software\
|
|
state: directory
|
|
|
|
- name: Copy {{Note_install}}
|
|
win_copy:
|
|
src: ~/ansible/install/{{Note_install}}
|
|
dest: D:\software\{{Note_install}}
|
|
|
|
- name: Send notification message via Slack
|
|
delegate_to: localhost
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: Starting Note_install on {{ inventory_hostname }}
|
|
|
|
- name: Run {{Note_install}}
|
|
ansible.windows.win_powershell:
|
|
script: |
|
|
D:\Sofware\{{Note_install}} /S
|
|
Get-Process npp* | Wait-Process
|
|
|
|
|
|
- name: Send notification message via Slack
|
|
delegate_to: localhost
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: Checking Version installed on {{ inventory_hostname }}
|
|
|
|
- name: Version Check
|
|
ansible.windows.win_powershell:
|
|
script: |
|
|
$log = Get-Item 'C:\Program Files\Notepad++\change.log'
|
|
$topline = $log | Get-Content | Select -First 1
|
|
|
|
if($result.Matches[0].Groups[1].Value -match 'Notepad\+\+ v8.4.1') {
|
|
$Ansible.Failed = $true
|
|
}
|
|
|
|
|
|
###name: Clean up
|
|
### ansible.windows.win_file:
|
|
### path: D:\software\{{Note_install}}
|
|
### state: absent
|