Files
ansible/test/integration/targets/ssh_agent/auto.yml
Martin Krizek 244c2f06ed Add ssh-agent launching, and ssh-agent python client (#84754)
* Add ssh-agent launching, and ssh-agent python client

* Move things around, is this better??

* docs

* postpone creating dir after bin lookup

* fix method name

* changelog ssh agent

* address reviews

* fix typing

* do not redefine public_key

* typing

* more typing

* Catch OSError when starting ssh agent

* likely copy pasted old code

* var type fix

* why is this needed?

ci_complete

* ignoring the change for now

* write out pub key file atomically

* defensive timeout for the socket

* _populate_agent docstring

* do not allow setting these in config

* check expected length before slicing blobs

* test all key types

* remove lock/unlock functionality

* docstring

* private _ssh_agent

* .

* launch agent in cli and ansible_ssh_*

* additional info for ssh-agent comment

* Add tests for remove and remove_all

* comment on os.rename

* hopefully mitigate agent startup/delays problems

* exceptions

* unused import

* fix sanity

* perf

---------

Co-authored-by: Matt Martz <matt@sivel.net>
2025-04-10 15:30:34 -07:00

47 lines
870 B
YAML

- hosts: testhost
tasks:
- set_fact:
key_types:
- ed25519
- rsa
- ecdsa
- set_fact:
key_types: "{{ key_types + ['dsa'] }}"
when: ansible_distribution == "RedHat"
- 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