diff --git a/tests/playbooks/tests_802_1x.yml b/tests/playbooks/tests_802_1x.yml index 8151294..42f20a1 100644 --- a/tests/playbooks/tests_802_1x.yml +++ b/tests/playbooks/tests_802_1x.yml @@ -45,7 +45,7 @@ client_cert: /etc/pki/tls/client.pem ca_cert: /etc/pki/tls/cacert.pem - name: "TEST: I can ping the EAP server" - shell: ping -c1 203.0.113.1 + command: ping -c1 203.0.113.1 - import_role: name: linux-system-roles.network vars: @@ -64,7 +64,7 @@ dest: /etc/pki/ca-trust/source/anchors/cacert.pem mode: 0644 - name: Update ca trust - shell: update-ca-trust + command: update-ca-trust - import_role: name: linux-system-roles.network vars: @@ -88,7 +88,60 @@ system_ca_certs: True domain_suffix_match: example.com - name: "TEST: I can ping the EAP server" - shell: ping -c1 203.0.113.1 + command: ping -c1 203.0.113.1 + - import_role: + name: linux-system-roles.network + vars: + network_connections: + - name: "{{ interface }}" + persistent_state: absent + state: absent + - name: >- + TEST: 802.1x profile with unencrypted private key and ca_path + debug: + msg: "##################################################" + - name: Create directory for ca_path test + file: + path: "/etc/pki/tls/my_ca_certs" + state: directory + mode: 0755 + - name: Copy cacert to ca_path + copy: + src: "cacert.pem" + dest: "/etc/pki/tls/my_ca_certs/cacert.pem" + mode: 0644 + - name: Hash cacert + command: openssl x509 -hash -noout + -in /etc/pki/tls/my_ca_certs/cacert.pem + register: cacert_hash + - name: Add symlink for cacert + file: + state: link + path: "/etc/pki/tls/my_ca_certs/{{ cacert_hash.stdout }}.0" + src: cacert.pem + - import_role: + name: linux-system-roles.network + vars: + network_connections: + - name: "{{ interface }}" + interface_name: veth2 + state: up + type: ethernet + ip: + address: + - 203.0.113.2/24 + dhcp4: "no" + auto6: "no" + ieee802_1x: + identity: myhost + eap: tls + private_key: /etc/pki/tls/client.key.nocrypt + client_cert: /etc/pki/tls/client.pem + private_key_password_flags: + - not-required + ca_path: /etc/pki/tls/my_ca_certs + - name: "TEST: I can ping the EAP server" + command: ping -c1 203.0.113.1 always: - block: - import_role: diff --git a/tests/tasks/manage_test_interface.yml b/tests/tasks/manage_test_interface.yml index 61f68d1..924c1e3 100644 --- a/tests/tasks/manage_test_interface.yml +++ b/tests/tasks/manage_test_interface.yml @@ -17,33 +17,33 @@ # veth - name: Create veth interface {{ interface }} - shell: ip link add {{ interface }} type veth peer name peer{{ interface }} + command: ip link add {{ interface }} type veth peer name peer{{ interface }} when: "type == 'veth' and state == 'present' and interface not in current_interfaces" - name: Delete veth interface {{ interface }} - shell: ip link del {{ interface }} type veth + command: ip link del {{ interface }} type veth when: "type == 'veth' and state == 'absent' and interface in current_interfaces" # dummy - name: Create dummy interface {{ interface }} - shell: ip link add "{{ interface }}" type dummy + command: ip link add "{{ interface }}" type dummy when: "type == 'dummy' and state == 'present' and interface not in current_interfaces" - name: Delete dummy interface {{ interface }} - shell: ip link del "{{ interface }}" type dummy + command: ip link del "{{ interface }}" type dummy when: "type == 'dummy' and state == 'absent' and interface in current_interfaces" # tap - name: Create tap interface {{ interface }} - shell: ip tuntap add dev {{ interface }} mode tap + command: ip tuntap add dev {{ interface }} mode tap when: "type == 'tap' and state == 'present' and interface not in current_interfaces" - name: Delete tap interface {{ interface }} - shell: ip tuntap del dev {{ interface }} mode tap + command: ip tuntap del dev {{ interface }} mode tap when: "type == 'tap' and state == 'absent' and interface in current_interfaces"