|
6 | 6 | http_proxy: "{{ lookup('env', 'http_proxy') | default(omit) }}" |
7 | 7 | https_proxy: "{{ lookup('env', 'https_proxy') | default(omit) }}" |
8 | 8 | no_proxy: "{{ lookup('env', 'no_proxy') | default(omit) }}" |
9 | | - roles: |
10 | | - - geerlingguy.git |
11 | 9 | tasks: |
12 | | - - name: install fake SuSE-release for cinc compatibility |
13 | | - copy: |
14 | | - content: | |
15 | | - openSUSE Faked Enterprise 2020 (x86_64) |
16 | | - VERSION = 2020 |
17 | | - CODENAME = Faked Feature |
18 | | - dest: /etc/SuSE-release |
19 | | - owner: root |
20 | | - group: root |
21 | | - mode: '0444' |
22 | | - when: ansible_facts.os_family == 'Suse' |
23 | | - |
24 | | - - name: install git for SuSE since geerlinguy.git does not support it |
25 | | - zypper: |
26 | | - name: git |
27 | | - state: present |
28 | | - when: ansible_facts.os_family == 'Suse' |
| 10 | + - name: Use Python 3 on Suse |
| 11 | + set_fact: |
| 12 | + ansible_python_interpreter: /usr/bin/python3 |
| 13 | + when: |
| 14 | + - ansible_os_family == 'Suse' |
29 | 15 |
|
30 | 16 | - name: install procps for debian systems |
31 | 17 | apt: |
|
34 | 20 | update_cache: true |
35 | 21 | when: ansible_distribution == 'Debian' |
36 | 22 |
|
37 | | - - name: Use Python 3 on Suse |
38 | | - set_fact: |
39 | | - ansible_python_interpreter: /usr/bin/python3 |
40 | | - when: |
41 | | - - ansible_os_family == 'Suse' |
42 | | - |
43 | 23 | - name: include tests for the service |
44 | 24 | include_tasks: verify_tasks/service.yml |
45 | 25 |
|
46 | 26 | - name: include tests for MySQL user |
47 | 27 | include_tasks: verify_tasks/mysql_users.yml |
48 | 28 |
|
49 | | - - name: download cinc-auditor |
50 | | - get_url: |
51 | | - url: https://omnitruck.cinc.sh/install.sh |
52 | | - dest: /tmp/install.sh |
53 | | - mode: '0775' |
54 | | - |
55 | | - - name: install cinc-auditor |
56 | | - shell: "bash /tmp/install.sh -s -- -P cinc-auditor -v 4" |
57 | | - |
| 29 | +- name: Verify |
| 30 | + hosts: localhost |
| 31 | + environment: |
| 32 | + http_proxy: "{{ lookup('env', 'http_proxy') | default(omit) }}" |
| 33 | + https_proxy: "{{ lookup('env', 'https_proxy') | default(omit) }}" |
| 34 | + no_proxy: "{{ lookup('env', 'no_proxy') | default(omit) }}" |
| 35 | + tasks: |
58 | 36 | - name: Execute cinc-auditor tests |
59 | | - command: "/opt/cinc-auditor/bin/cinc-auditor exec --no-show-progress --no-color --no-distinct-exit https://github.com/dev-sec/mysql-baseline/archive/refs/heads/master.zip" |
| 37 | + command: > |
| 38 | + docker run |
| 39 | + --volume /run/docker.sock:/run/docker.sock |
| 40 | + docker.io/cincproject/auditor exec |
| 41 | + -t docker://instance |
| 42 | + --no-show-progress --no-color |
| 43 | + --no-distinct-exit https://github.com/dev-sec/mysql-baseline/archive/refs/heads/master.zip |
60 | 44 | register: test_results |
61 | 45 | changed_when: false |
62 | 46 | ignore_errors: true |
|
0 commit comments