File: auto.yml

package info (click to toggle)
ansible-core 2.19.0~beta6-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,628 kB
  • sloc: python: 180,313; cs: 4,929; sh: 4,601; xml: 34; makefile: 21
file content (48 lines) | stat: -rw-r--r-- 936 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- hosts: testhost
  tasks:
    - set_fact:
        key_types:
          - ed25519
          - rsa
          - ecdsa

    - set_fact:
        key_types: "{{ key_types + ['dsa'] }}"
      when:
        - ansible_distribution == "RedHat"
        - ansible_distribution_major_version | int == 9

    - include_tasks: test_key.yml
      loop: "{{ key_types }}"
      loop_control:
        extended: true

    - ssh_agent:
        action: remove
        pubkey: "{{ sshkey.public_key }}"

    - ssh_agent:
        action: list
      register: keys

    - assert:
        that:
          - keys.nkeys == key_types | length - 1

    - name: remove all keys
      ssh_agent:
        action: remove_all
      register: r

    - assert:
        that:
          - r is success
          - r.nkeys_removed == key_types | length - 1

    - ssh_agent:
        action: list
      register: keys

    - assert:
        that:
          - keys.nkeys == 0