diff --git a/roles/ldap_server/molecule/default/prepare.yml b/roles/ldap_server/molecule/default/prepare.yml index b8fe70ad6d3b51be79b68e000cec88983b673e5b..f39aa74bc1ae8d161c37032696a92716e05b7f75 100644 --- a/roles/ldap_server/molecule/default/prepare.yml +++ b/roles/ldap_server/molecule/default/prepare.yml @@ -1,6 +1,6 @@ --- -- name: Set-up fixtures +- name: Prepare, test fixtures hosts: localhost connection: local gather_facts: false @@ -36,17 +36,14 @@ - name: Prepare hosts: all + become: true gather_facts: false tasks: + - name: Install python for Ansible raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3-minimal) - become: true changed_when: false -- hosts: all - become: true - tasks: - - name: Update all caches to avoid errors due to missing remote archives apt: update_cache: true @@ -60,7 +57,21 @@ group: root mode: 0644 -- hosts: client + - name: Remove the ss utility (see https://github.com/philpep/testinfra/pull/320) + file: + path: "/bin/ss" + state: absent + + - name: Install tools for testing + apt: + name: + - net-tools + - nmap + - gnutls-bin + state: present + +- name: Prepare, helpers + hosts: client become: true tasks: @@ -82,7 +93,8 @@ 192.168.56.21: parameters-mandatory-bookworm 192.168.56.22: parameters-optional-bookworm -- hosts: parameters-optional +- name: Prepare, test fixtures + hosts: parameters-optional become: true tasks: @@ -98,7 +110,8 @@ with_dict: 127.0.2.1: parameters-optional -- hosts: parameters-mandatory +- name: Prepare, test fixtures + hosts: parameters-mandatory become: true tasks: @@ -114,7 +127,8 @@ with_dict: 127.0.2.1: parameters-mandatory -- hosts: backup-server +- name: Prepare, helpers + hosts: backup-server become: true roles: - role: backup_server @@ -126,20 +140,3 @@ - server: localhost ip: 127.0.0.1 public_key: "{{ lookup('file', 'tests/data/ssh/parameters-optional.pub') }}" - -- hosts: parameters-mandatory,parameters-optional - become: true - tasks: - - - name: Remove the ss utility (see https://github.com/philpep/testinfra/pull/320) - file: - path: "/bin/ss" - state: absent - - - name: Install tools for testing - apt: - name: - - net-tools - - nmap - - gnutls-bin - state: present