|
1 | 1 | --- |
2 | | -- name: wrapper playbook for kitchen testing "ansible-os-hardening" with custom vars for testing |
| 2 | +- name: Wrapper playbook for kitchen testing "ansible-os-hardening" with custom vars for testing |
3 | 3 | hosts: all |
4 | 4 | become: true |
5 | 5 | environment: |
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 | 9 | tasks: |
10 | | - - name: set ansible_python_interpreter to "/usr/bin/python3" on fedora |
11 | | - set_fact: |
12 | | - ansible_python_interpreter: "/usr/bin/python3" |
13 | | - when: ansible_facts.distribution == 'Fedora' |
14 | | - |
15 | | - - name: Run the equivalent of "apt-get update && apt-get upgrade" |
16 | | - apt: |
17 | | - name: "*" |
18 | | - state: latest |
| 10 | + - name: Install Python3 on Debian 10 |
| 11 | + ansible.builtin.apt: |
| 12 | + name: python3 |
| 13 | + state: present |
19 | 14 | update_cache: true |
20 | 15 | when: ansible_os_family == 'Debian' |
21 | 16 |
|
22 | | - - name: install required tools on SuSE |
| 17 | + - name: Set ansible_python_interpreter to "/usr/bin/python3" |
| 18 | + ansible.builtin.set_fact: |
| 19 | + ansible_python_interpreter: /usr/bin/python3 |
| 20 | + |
| 21 | + - name: Install required tools on SuSE |
23 | 22 | # cannot use zypper module, since it depends on python-xml |
24 | | - shell: "zypper -n install python-xml" |
| 23 | + ansible.builtin.shell: zypper -n install python-xml |
25 | 24 | when: ansible_facts.os_family == 'Suse' |
26 | 25 |
|
27 | | - - name: install required tools on fedora |
28 | | - dnf: |
| 26 | + - name: Install required tools on fedora |
| 27 | + ansible.builtin.dnf: |
29 | 28 | name: |
30 | 29 | - python |
31 | 30 | - findutils |
32 | 31 | - procps-ng |
33 | 32 | when: ansible_facts.distribution == 'Fedora' |
34 | 33 |
|
35 | | - - name: install required tools on Arch |
| 34 | + - name: Install required tools on Arch |
36 | 35 | community.general.pacman: |
37 | 36 | name: |
38 | 37 | - awk |
39 | 38 | state: present |
40 | 39 | update_cache: true |
41 | 40 | when: ansible_facts.os_family == 'Archlinux' |
42 | 41 |
|
43 | | - - name: install required tools on RHEL # noqa ignore-errors |
44 | | - yum: |
| 42 | + - name: Install required tools on RHEL # noqa ignore-errors |
| 43 | + ansible.builtin.yum: |
45 | 44 | name: |
46 | 45 | - openssh-clients |
47 | 46 | - openssh |
48 | 47 | state: present |
49 | 48 | update_cache: true |
50 | 49 | ignore_errors: true |
51 | 50 |
|
52 | | - - name: create recursing symlink to test minimize access |
53 | | - shell: "rm -f /usr/bin/zzz && ln -s /usr/bin /usr/bin/zzz" |
| 51 | + - name: Create recursing symlink to test minimize access |
| 52 | + ansible.builtin.shell: rm -f /usr/bin/zzz && ln -s /usr/bin /usr/bin/zzz |
54 | 53 | changed_when: false |
55 | 54 |
|
56 | | - - name: include YUM prepare tasks |
57 | | - include_tasks: prepare_tasks/yum.yml |
| 55 | + - name: Include YUM prepare tasks |
| 56 | + ansible.builtin.include_tasks: prepare_tasks/yum.yml |
58 | 57 | when: ansible_facts.os_family == 'RedHat' |
59 | 58 |
|
60 | | - - name: include preparation tasks |
| 59 | + - name: Include preparation tasks |
61 | 60 | ansible.builtin.include_tasks: |
62 | 61 | file: "{{ item }}" |
63 | 62 | loop: |
|
0 commit comments