Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssh_keypair: check_mode should return public key #113

Closed
tpo opened this issue Sep 29, 2020 · 1 comment · Fixed by #230
Closed

openssh_keypair: check_mode should return public key #113

tpo opened this issue Sep 29, 2020 · 1 comment · Fixed by #230
Labels
enhancement New feature or request

Comments

@tpo
Copy link

tpo commented Sep 29, 2020

SUMMARY

When running in check mode, the openssh_keypair module returns "public_key": {}.
Can the module please return the current key, at least if no changes would be required?

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

openssh_keypair

ADDITIONAL INFORMATION

Copied from ansible/ansible#67185

See suggested workarounds:

FYI @joernheissler @clarsen @MarkusTeufelberger

STEPS TO REPRODUCE

Run that once without and then with check mode enabled:

- name: create key
  openssh_keypair:
    path: /root/.ssh/somekey
  register: somevar

EXPECTED RESULTS

I expect somevar.public_key to contain the public key.

ACTUAL RESULTS

ok: [somehost] => changed=false
  comment: ''
  filename: /root/.ssh/somekey
  fingerprint: ''
  public_key: {}
  size: 256
  type: ed25519
@tpo
Copy link
Author

tpo commented May 12, 2021

Woah, many thanks 🙏 @Ajpantuso and @felixfontein !!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants