Skip to content

Commit

Permalink
Merge pull request #29 from IBM/dariuszglocki
Browse files Browse the repository at this point in the history
9.2.31.0 release
  • Loading branch information
DariuszGlocki authored Mar 20, 2023
2 parents 68cc795 + f4572f6 commit 35a4634
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Disconnected scans allow for discovering software and hardware inventory by running scripts that are provided in the disconnected scanner package. The scripts initiate software and capacity scans, and create a package with scan results that you later need to upload to the License Metric Tool server. You can automate management of disconnected scans by using [Ansible](https://docs.ansible.com/ansible/latest/index.html#about-ansible).

The current version of License Metric Tool playbooks is **9.2.30**
The current version of License Metric Tool playbooks is **9.2.31**


## Prerequisites
Expand Down
27 changes: 22 additions & 5 deletions roles/ilmt_scanner/tasks/collect_troubleshooting_data_ibmi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
register: ibmi_endpoint_id
changed_when: false

- name: "Run collect troubleshooting data script on IBM i endpoints"
command: "qsh collect_support_data.sh"
args:
chdir: "{{ lmt_scanner_path_ibmi }}"

- name: Get files in folder support_data
find:
paths: "{{ lmt_scanner_path_ibmi }}/support_data"
register: found_support_data

- name: Get latest troubleshooting file
set_fact:
latest_support_file: "{{ (found_support_data.files | sort(attribute='mtime') | last).path }}"

- name: "Remove troubleshooting data archive from IBM i endpoints"
file:
state: absent
Expand Down Expand Up @@ -46,14 +60,17 @@
community.general.archive:
path:
- "{{ lmt_scanner_path_ibmi }}/ansible_facts.txt"
- "{{ lmt_scanner_path_ibmi }}/config"
- "{{ lmt_scanner_path_ibmi }}/logs"
- "{{ lmt_scanner_path_ibmi }}/iso-swid"
- "{{ lmt_scanner_path_ibmi }}/output"
- "{{ lmt_scanner_path_ibmi }}/*-{{ ibmi_endpoint_id.stdout }}.zip"
- "{{ latest_support_file }}"
dest: "{{ lmt_scanner_path_ibmi }}/{{ ansible_host }}_{{ ibmi_endpoint_id.stdout }}.zip"
format: zip
force_archive: true
register: archive

- name: "Remove troubleshooting data collected by script from IBM i endpoints"
file:
state: absent
path: "{{ latest_support_file }}"
when: archive is succeeded

- name: "Fetch troubleshooting data archive from IBM i endpoints"
fetch:
Expand Down
27 changes: 22 additions & 5 deletions roles/ilmt_scanner/tasks/collect_troubleshooting_data_unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
register: unix_endpoint_id
changed_when: false

- name: "Run collect troubleshooting data script on UNIX/Linux endpoints"
shell: ./collect_support_data.sh
args:
chdir: "{{ lmt_scanner_path_unix }}"

- name: "Get files in folder support_data on UNIX/Linux endpoints"
find:
paths: "{{ lmt_scanner_path_unix }}/support_data"
register: found_support_data

- name: "Get latest troubleshooting data file on UNIX/Linux endpoints"
set_fact:
latest_support_file: "{{ (found_support_data.files | sort(attribute='mtime') | last).path }}"

- name: "Remove troubleshooting data archive from UNIX/Linux endpoints"
file:
state: absent
Expand Down Expand Up @@ -46,14 +60,17 @@
community.general.archive:
path:
- "{{ lmt_scanner_path_unix }}/work/ansible_facts.txt"
- "{{ lmt_scanner_path_unix }}/config"
- "{{ lmt_scanner_path_unix }}/logs"
- "{{ lmt_scanner_path_unix }}/iso-swid"
- "{{ lmt_scanner_path_unix }}/work"
- "{{ lmt_scanner_output_path_unix if ( lmt_scanner_output_path_unix is defined ) else lmt_scanner_path_unix + '/output' }}"
- "{{ latest_support_file }}"
dest: "{{ lmt_scanner_path_unix }}/work/{{ ansible_host }}_{{ unix_endpoint_id.stdout }}.tar.gz"
format: gz
force_archive: true
register: archive

- name: "Remove troubleshooting data collected by script from UNIX/Linux endpoints"
file:
state: absent
path: "{{ latest_support_file }}"
when: archive is succeeded

- name: "Fetch troubleshooting data archive from UNIX/Linux endpoints"
fetch:
Expand Down
27 changes: 22 additions & 5 deletions roles/ilmt_scanner/tasks/collect_troubleshooting_data_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
win_command: "cmd.exe /c type \"{{ lmt_scanner_path_windows }}\\config\\endpoint_id.txt\" "
register: windows_endpoint_id

- name: "Run collect troubleshooting data script on Windows endpoints"
win_command: collect_support_data.bat
args:
chdir: "{{ lmt_scanner_path_windows }}"

- name: Get files in folder support_data
ansible.windows.win_find:
paths: "{{ lmt_scanner_path_windows }}\\support_data"
register: found_support_data

- name: Get latest troubleshooting data file
set_fact:
latest_support_file: "{{ (found_support_data.files | sort(attribute='lastwritetime') | last).path }}"

- name: "Remove troubleshooting data archive from Windows endpoints"
win_file:
state: absent
Expand Down Expand Up @@ -41,13 +55,16 @@
win_command: "cmd.exe /c \"\"{{ lmt_scanner_path_windows }}\\bin\\zip.exe\" -S -X -r \
\"{{ lmt_scanner_path_windows }}\\work\\{{ ansible_host }}_{{ windows_endpoint_id.stdout_lines[0] }}.zip\" \
\"{{ lmt_scanner_path_windows }}\\work\\ansible_facts.txt\" \
\"{{ lmt_scanner_path_windows }}\\config\" \
\"{{ lmt_scanner_path_windows }}\\logs\" \
\"{{ lmt_scanner_path_windows }}\\iso-swid\" \
\"{{ lmt_scanner_path_windows }}\\work\" \
\"{{ lmt_scanner_output_path_windows if ( lmt_scanner_output_path_windows is defined) else lmt_scanner_path_windows + '\\output' }}\"\" "
\"{{ latest_support_file }}\"\" "
args:
chdir: "{{ lmt_scanner_path_windows }}"
register: archive

- name: "Remove troubleshooting data collected by script from Windows endpoints"
win_file:
state: absent
path: "{{ latest_support_file }}"
when: archive is succeeded

- name: "Fetch troubleshooting data archive from Windows endpoints"
fetch:
Expand Down
2 changes: 1 addition & 1 deletion roles/ilmt_scanner/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ lmt_scanner_aix_scanner_minimum_disk_space: 100
# required_ibmi_space_in_MBs
lmt_scanner_ibmi_scanner_minimum_disk_space: 120
# Playbooks version - should be in-line with LMT server version and upgraded during each release
lmt_playbooks_version: "9.2.30.0"
lmt_playbooks_version: "9.2.31.0"

0 comments on commit 35a4634

Please sign in to comment.