mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-08 11:39:02 +00:00
Add public key return to openssh_keypair (#53214)
- The openssh_keypair module will return a public key output on the private key creation. - Add integration test in order to verify the public key output.
This commit is contained in:
parent
139abd0849
commit
8ba2e15578
3 changed files with 23 additions and 0 deletions
|
|
@ -22,4 +22,9 @@
|
|||
state: absent
|
||||
path: '{{ output_dir }}/privatekey4'
|
||||
|
||||
- name: Generate privatekey5 - standard
|
||||
openssh_keypair:
|
||||
path: '{{ output_dir }}/privatekey5'
|
||||
register: publickey_gen
|
||||
|
||||
- import_tasks: ../tests/validate.yml
|
||||
|
|
|
|||
|
|
@ -37,3 +37,9 @@
|
|||
assert:
|
||||
that:
|
||||
- privatekey4.stat.exists == False
|
||||
|
||||
|
||||
- name: Validate privatekey5 (assert - Public key module output equal to the public key on host)
|
||||
assert:
|
||||
that:
|
||||
- "publickey_gen.public_key == lookup('file', output_dir ~ '/privatekey5.pub').strip('\n')"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue