diff --git a/.github/ISSUE_TEMPLATE/viya-ark-bug-report.md b/.github/ISSUE_TEMPLATE/viya-ark-bug-report.md new file mode 100644 index 0000000..814d823 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/viya-ark-bug-report.md @@ -0,0 +1,27 @@ +--- +name: Viya ARK Bug report +about: Help us to improve our code. +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the issue is. + +**Environment** +- [ ] Ansible version: +- [ ] Python version: +- [ ] OS version: +- [ ] Failed playbook tasks log (or entire playbook log) [Attach] +- [ ] What version of Viya 3.x is being deployed? + +**To Reproduce** +Steps to reproduce the behavior: +1. Firstly, ... +2. Then, ... +3. + +**Expected behavior** +A clear and concise description of what you expected to happen. diff --git a/.github/ISSUE_TEMPLATE/viya-ark-feature-request.md b/.github/ISSUE_TEMPLATE/viya-ark-feature-request.md new file mode 100644 index 0000000..139bb24 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/viya-ark-feature-request.md @@ -0,0 +1,20 @@ +--- +name: Viya ARK Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3423c85..bde8b4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,20 @@ # Changelog for SAS Viya ARK +## Viya35-ark-1.10 - October 20, 2020 +- **Summary**: + Changing range of Ansible versions supported. Enhancing obsolete log archiving. +- Issues addressed: + - General + - VIYAARK-188 - Support Ansible 2.10. + - VIYAARK-216 - Add Bug Report template to GitHub Issue submission. + - SAS Viya Upgrade Tasks Playbooks + - VIYAARK-104 - Produce summary report for Archive Obsolete Folders playbook. +- Ansible Support: Ansible 2.8 - Ansible 2.10 + + + + ## Viya35-ark-1.9 - September 30, 2020 - **Summary**: Fix related to MMSU, Pre-Install & Post Upgrade. @@ -13,7 +27,6 @@ - VIYAARK-103 - Add a confirmation before stopping - Ansible Support: Ansible 2.7.2 - Ansible 2.9 - ## Viya35-ark-1.8 - August 31, 2020 - **Summary**: diff --git a/playbooks/pre-install-playbook/roles/viya-ark.preinstall/defaults/main.yml b/playbooks/pre-install-playbook/roles/viya-ark.preinstall/defaults/main.yml index e434cc2..82d9708 100644 --- a/playbooks/pre-install-playbook/roles/viya-ark.preinstall/defaults/main.yml +++ b/playbooks/pre-install-playbook/roles/viya-ark.preinstall/defaults/main.yml @@ -186,9 +186,9 @@ sas_yum_urls: ## third-party software requirements -required_ansible_min_version: "2.7.2" -required_ansible_max_version: "2.9" -ansible_version_compare_max_version: "2.10" # Must be set one major version above required_ansible_max_version +required_ansible_min_version: "2.8" +required_ansible_max_version: "2.10" +ansible_version_compare_max_version: "2.11" # Must be set one major version above required_ansible_max_version required_python_min_version: "2.6" diff --git a/playbooks/viya-upgrade/README.md b/playbooks/viya-upgrade/README.md index 750d3da..bf178d9 100644 --- a/playbooks/viya-upgrade/README.md +++ b/playbooks/viya-upgrade/README.md @@ -60,9 +60,10 @@ The following plays are run separate from the pre-upgrade and post-upgrade playb - The `archive_obsolete_log_folders.yml` playbook archives a specific set of directories that are related to services and components from previous SAS Viya versions that have now been discontinued or have merged with other services and components. - The playbook contains the list of obsoleted directories for archiving. By default, the playbook looks for these directories under _/opt/sas/viya/config/var/log_ and moves them to _/opt/sas/viya/config/var/log/archived_. - The playbook has `become_user` set to "sas" and all tasks are run as the sas user by default. - - The log directory path is set in variable `viya_log_path` and is _/opt/sas/viya/config/var/log_ by default. The archive path is set in variable `viya_log_archive_path` and is _/opt/sas/viya/config/var/log/archived_ by default. You can override the defaults by editing the variables in the playbook file, or on the command line by setting the variables using the -e option: + - The log directory path is set in variable `viya_log_path` and is _/opt/sas/viya/config/var/log_ by default. The archive path is set in variable `viya_log_archive_path` and is _/opt/sas/viya/config/var/log/archived_ by default. You can override the defaults by editing the variables in the playbook file, or on the command line by setting the variables using the -e option. + - The playbook creates an HTML report showing archive results. The report is written to the archive path by default. The report location can be overridden by editing the `report_output_path` variable in the playbook or on the command line using the -e option: ```` -ansible-playbook archive_obsolete_log_folders.yml -i inventory -e "viya_log_archive_path=/example/writable/path" +ansible-playbook archive_obsolete_log_folders.yml -i inventory -e "viya_log_archive_path=/example/writable/path" -e "report_output_path=/path" ```` ## Useful Optional Arguments diff --git a/playbooks/viya-upgrade/archive_obsolete_log_folders.yml b/playbooks/viya-upgrade/archive_obsolete_log_folders.yml index 4b1d93c..8b9af77 100755 --- a/playbooks/viya-upgrade/archive_obsolete_log_folders.yml +++ b/playbooks/viya-upgrade/archive_obsolete_log_folders.yml @@ -16,11 +16,13 @@ # # This playbook is intended for use in SAS Viya 3.5 environments. # -# By default these old service directories are archived to /opt/sas/viya/config/var/log/archived +# By default the old service directories are archived to /opt/sas/viya/config/var/log/archived +# +# By default the html report is written to /opt/sas/viya/config/var/log/archived # -# This location can be overridden by passing an alternate path on the command line: +# These location can be overridden by passing an alternate path on the command line: # -# ansible-playbook archive_obsolete_log_folders.yml -i inventory -e "viya_log_archive_path=/your/writable/path/folder" +# ansible-playbook archive_obsolete_log_folders.yml -i inventory -e "viya_log_archive_path=/your/writable/path/folder" -e "report_output_path=/path" # # ##################################################################################################### @@ -33,6 +35,9 @@ vars: viya_log_path: "/opt/sas/viya/config/var/log" viya_log_archive_path: "{{viya_log_path}}/archived" + report_file_name: "archive_obsolete_log_folders_report" + report_output_path: "{{ viya_log_archive_path }}" + archival_report_file: "{{ report_output_path | realpath }}/{{ report_file_name + '_' + '%F_%H-%M-%S'|strftime(ansible_date_time.epoch) + '.html' }}" folders_to_archive: - analytics-components @@ -128,7 +133,7 @@ - name: "***WARNING: This playbook is for use in SAS Viya 3.5 deployments. Please abort if you are running with a different version of SAS Viya." pause: seconds: 20 - prompt: "Press 'Ctl+C' and then 'A' to abort the process. The playbook will continue after 20 seconds" + prompt: "Press 'Ctl+C' and then 'A' to abort the process. The playbook will continue after 20 seconds." when: (ansible_check_mode == False) and (use_pause == True) # On SUSE, if the package for the corresponding log folder is still installed then we will skip archiving the log folder. @@ -168,6 +173,25 @@ args: removes: "{{viya_log_path}}/{{item.item}}" become: yes - become_user: root + become_user: root + register: moved_folder_status when: item.rc != 0 with_items: "{% if ansible_os_family == suse_os_name|string %}{{package_status_suse.results}}{% else %}{{package_status_rhel.results}}{% endif %}" + + - name: Get the value of hostname -f + shell: "hostname -f" + changed_when: False + register: full_hostname + + - name: "Create Log Folder Archive HTML Report" + template: + src: templates/archive_obsolete_log_folders_report.html.j2 + dest: "{{ archival_report_file }}" + mode: 0660 + run_once: true + + - name: "Log Folder Archive Report location" + debug: + msg: "Created {{ archival_report_file }}" + run_once: true + diff --git a/playbooks/viya-upgrade/templates/archive_obsolete_log_folders_report.html.j2 b/playbooks/viya-upgrade/templates/archive_obsolete_log_folders_report.html.j2 new file mode 100644 index 0000000..e2faaba --- /dev/null +++ b/playbooks/viya-upgrade/templates/archive_obsolete_log_folders_report.html.j2 @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + +Archive Oboslete Log Folders Report + + + + + + + + + + + + + + + + + + + + +
+ SAS - The Power to Know
+

Archive Obsolete Log Folders - Report

+

Host: {{ full_hostname.stdout }}

+
+ SAS radiance image +
+ + +
+ +
+ +
+
+

+

    + {% for moved in moved_folder_status.results if not "skipped" in moved.stdout %} +
  1. {{ moved.item.item }}
  2. + {% else %} + No folders moved. + {% endfor %} +
+

+
+
+
+

+

    + {% for unmoved in moved_folder_status.results if "skipped" in unmoved.stdout %} +
  1. {{ unmoved.item.item }}
  2. + {% else %} + All folders moved. + {% endfor %} +
+

+

+
+

+

    + {% for all_folder in folders_to_archive %} +
  1. {{ all_folder }}
  2. + {% endfor %} +
+

+
+
+ +
+ + +