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:
Maxim Babushkin
2019-03-05 18:07:43 +02:00
committed by John R Barker
parent 139abd0849
commit 8ba2e15578
3 changed files with 23 additions and 0 deletions

View File

@@ -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

View File

@@ -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')"