49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
---
|
|
|
|
- name: Copy CrystalDiskInfo archive
|
|
ansible.windows.win_copy:
|
|
src: /var/jenkins_home/ansible-files/programs/CrystalDiskInfo.zip
|
|
dest: "{{ storage_api_root }}\\CrystalDiskInfo.zip"
|
|
|
|
- name: Extract CrystalDiskInfo archive
|
|
community.windows.win_unzip:
|
|
src: "{{ storage_api_root }}\\CrystalDiskInfo.zip"
|
|
dest: "{{ storage_api_root }}\\dist\\"
|
|
|
|
- name: Install nssm
|
|
win_chocolatey:
|
|
name: nssm
|
|
state: present
|
|
|
|
- name: Install disk_api service
|
|
community.windows.win_nssm:
|
|
name: "{{ disk_service_name }}"
|
|
application: "{{ storage_api_root }}\\dist\\disk_service.exe"
|
|
|
|
- name: Set disk_api service startup auto and start
|
|
ansible.windows.win_service:
|
|
name: "{{ disk_service_name }}"
|
|
start_mode: auto
|
|
state: started
|
|
register: disk_service_status
|
|
|
|
- name: Show service result
|
|
debug:
|
|
msg:
|
|
- "name........ {{ disk_service_status.name }}"
|
|
- "exists...... {{ disk_service_status.exists }}"
|
|
- "path........ {{ disk_service_status.path }}"
|
|
- "start_mode.. {{ disk_service_status.start_mode }}"
|
|
- "state....... {{ disk_service_status.state }}"
|
|
- "username.... {{ disk_service_status.username }}"
|
|
- "failed...... {{ disk_service_status.failed }}"
|
|
|
|
- name: Test API
|
|
win_shell: "C:\\Windows\\system32\\curl http://{{ ansible_ssh_host }}:5000/disk"
|
|
register: api_test_output
|
|
|
|
- name: Show Test Results
|
|
debug:
|
|
msg: "{{ api_test_output.stdout_lines }}"
|
|
|
|
... |