diff --git a/tasks/2-scan.yml b/tasks/2-scan.yml index 75e9a808a1b81385a63997970a9d06beed939cbb..48cf0cc561cd40e189ceb1f0fc3aa80805d269e0 100644 --- a/tasks/2-scan.yml +++ b/tasks/2-scan.yml @@ -73,20 +73,18 @@ with_items: "{{ report_files.files }}" when: summary_report_json.global == 'NOK' -- name: Load scans log - command: cat "{{ paas_ci_workdir + '/scan.log' }}" - register: scan_log - #when: summary_report_json.global == 'NOK' - -- name: import scan_log - set_fact: - imported_scan_log: "{{ scan_log.stdout }}" - #when: summary_report_json.global == 'NOK' - -- name: Show scans log - debug: - var: imported_scan_log - #when: summary_report_json.global == 'NOK' +- name: Show scan log if vulnerability detected + block: + - name: Load log + command: cat "{{ paas_ci_workdir + '/scan.log' }}" + register: log + - name: import log + set_fact: + imported_log: "{{ log.stdout }}" + - name: Show log + debug: + var: imported_log + when: summary_report_json.global == 'NOK' - name: Detailed report summary debug: diff --git a/tests/test-simple-node-centos-7.yml b/tests/test-simple-node-centos-7.yml new file mode 100644 index 0000000000000000000000000000000000000000..f22e4ad1e8d007a3d8ffda5aafffcbf1f5639779 --- /dev/null +++ b/tests/test-simple-node-centos-7.yml @@ -0,0 +1,17 @@ +--- +- hosts: localhost + connection: local + remote_user: root + tasks: + - name: Download paas-ci role + local_action: command ansible-galaxy install --force git+https://baltig.infn.it/infn-cloud/paas-ci.git + changed_when: false + + - include_role: + name: paas-ci + vars: + paas_ci_test: + template_url: https://baltig.infn.it/infn-cloud/tosca-templates/-/raw/master/single-vm/single_vm.yaml + n_timeout_ticks: 90 + inputs: | + '{ "os_distribution":"centos", "os_version": "7", "users": [{"os_user_add_to_sudoers": true, "os_user_name": "scans", "os_user_ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmQvE3sXtg4D/KYzhCdP6cICvy5foeSkHenKTisxdGJK8L0cDmV+4k7fIah1GIXrldjQBGWHSTbIj1qRTXG2OPWFxeDoXIN1FyKxwdOgwIfzIRtVq18VZEqt9eOiNUXN8jGoEAgcU7obqXuPqKAndk4tyOnSDuVnfnZWAiesVvWK16GEq0PAxBhJoX3eq501ilsNnJZDMEnvQEgtFuIbADEanrhRV3yaEca+9vFyOQRkyxDF8Gn6P/wZ4oe35bdgXxi/hg8JVKYbDCLlT+Fdi+OC3trRhwCcBSvDFD0ZQ8oLemzUk+732TqR+I8gVjPE9fiNF+/mrj5OX55SDr8Qgf scans"}]}' \ No newline at end of file diff --git a/tests/test-simple-node-ubuntu-20.04.yml b/tests/test-simple-node-ubuntu-20.04.yml new file mode 100644 index 0000000000000000000000000000000000000000..7fd925db954cd8cb7c1b4b62b3e801cca95591b6 --- /dev/null +++ b/tests/test-simple-node-ubuntu-20.04.yml @@ -0,0 +1,17 @@ +--- +- hosts: localhost + connection: local + remote_user: root + tasks: + - name: Download paas-ci role + local_action: command ansible-galaxy install --force git+https://baltig.infn.it/infn-cloud/paas-ci.git + changed_when: false + + - include_role: + name: paas-ci + vars: + paas_ci_test: + template_url: https://baltig.infn.it/infn-cloud/tosca-templates/-/raw/master/single-vm/single_vm.yaml + n_timeout_ticks: 90 + inputs: | + '{ "os_distribution":"ubuntu", "os_version": "20.04", "users": [{"os_user_add_to_sudoers": true, "os_user_name": "scans", "os_user_ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmQvE3sXtg4D/KYzhCdP6cICvy5foeSkHenKTisxdGJK8L0cDmV+4k7fIah1GIXrldjQBGWHSTbIj1qRTXG2OPWFxeDoXIN1FyKxwdOgwIfzIRtVq18VZEqt9eOiNUXN8jGoEAgcU7obqXuPqKAndk4tyOnSDuVnfnZWAiesVvWK16GEq0PAxBhJoX3eq501ilsNnJZDMEnvQEgtFuIbADEanrhRV3yaEca+9vFyOQRkyxDF8Gn6P/wZ4oe35bdgXxi/hg8JVKYbDCLlT+Fdi+OC3trRhwCcBSvDFD0ZQ8oLemzUk+732TqR+I8gVjPE9fiNF+/mrj5OX55SDr8Qgf scans"}]}' \ No newline at end of file