mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +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:
committed by
John R Barker
parent
139abd0849
commit
8ba2e15578
@@ -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')"
|
||||
|
||||
Reference in New Issue
Block a user