diff --git a/roles/ldap_server/molecule/default/prepare.yml b/roles/ldap_server/molecule/default/prepare.yml index 53a41ad097f7ba71e05380e927379daa31c17ecb..9f733d49f5f2769e874ce7ca66862f6b40380f0a 100644 --- a/roles/ldap_server/molecule/default/prepare.yml +++ b/roles/ldap_server/molecule/default/prepare.yml @@ -2,21 +2,21 @@ - name: Prepare hosts: all - gather_facts: False + gather_facts: false tasks: - name: Install python for Ansible raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) - become: True - changed_when: False + become: true + changed_when: false - hosts: all - become: yes + become: true tasks: - name: Update all caches to avoid errors due to missing remote archives apt: - update_cache: yes - changed_when: False + update_cache: true + changed_when: false - name: Deploy CA certificate copy: @@ -27,16 +27,16 @@ mode: 0644 - hosts: client - become: yes + become: true tasks: - name: Install tool for teting TCP connectivity apt: name: hping3 - state: installed + state: present - hosts: parameters-optional - become: yes + become: true tasks: - name: Set-up the hosts file @@ -52,7 +52,7 @@ 127.0.2.1: parameters-optional - hosts: parameters-mandatory - become: yes + become: true tasks: - name: Set-up the hosts file @@ -66,3 +66,24 @@ state: present with_dict: 127.0.2.1: parameters-mandatory.local + +- hosts: backup-server + become: true + roles: + - role: backup_server + backup_host_ssh_private_keys: + dsa: "{{ lookup('file', 'tests/data/ssh/server_dsa') }}" + rsa: "{{ lookup('file', 'tests/data/ssh/server_rsa') }}" + ed25519: "{{ lookup('file', 'tests/data/ssh/server_ed25519') }}" + ecdsa: "{{ lookup('file', 'tests/data/ssh/server_ecdsa') }}" + backup_clients: + - 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: Rename the ss utility (see https://github.com/philpep/testinfra/pull/320) + command: "mv /bin/ss /bin/ss.bak"