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

check_mode suppor #40

Open
Ofthestreet opened this issue Oct 7, 2020 · 1 comment
Open

check_mode suppor #40

Ofthestreet opened this issue Oct 7, 2020 · 1 comment

Comments

@Ofthestreet
Copy link

In borg-client.yml, running the playbook in check mode is not possible since sshkey is undefined in the following task

- name: client | put sshpubkey on the normal backupserver
  authorized_key:
    user: "{{ item.user }}"
 ->   key: "{{ sshkey.stdout }}"

I would suggest to add a check_mode: no when fetching the ssh-key in order to validate the usage of sshkey.stdout

- name: client | fetch ssh-key
  command: "cat {{ borgbackup_ssh_key }}.pub"
  register: sshkey
  changed_when: false
  -> check_mode: no
  tags:
    - skip_ansible_lint

Note : As I am not a old ansible coder feel free to indicate why this is not already the case

@stroobl
Copy link
Contributor

stroobl commented Dec 31, 2021

Check mode was never tested while implementing the role, so I'm not sure if this would be the only issue? I expect that anything with ssh keys involved will fail if the key is not generated, so it probably doesn't make sense to implement check mode then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants