1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_weechat.git synced 2024-08-16 13:09:48 +02:00

improve creating ssh key creation for custom config

This commit is contained in:
L3D 2020-03-12 04:37:54 +01:00 committed by L3D
parent 42cd710101
commit 82181b0829
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B

View file

@ -1,16 +1,35 @@
--- ---
- name: create ssh key pair (if needed) - name: create ssh key pair (if needed)
become: true
become_user: "{{ weechat.user }}" become_user: "{{ weechat.user }}"
become: true
openssh_keypair: openssh_keypair:
path: "{{ weechat.home_directory }}/../.ssh/id_ed25519" path: "{{ weechat.home_directory }}/../.ssh/id_ed25519"
type: ed25519 type: ed25519
owner: "{{ weechat.user }}"
register: ssh_key_pair register: ssh_key_pair
when: weechat.custom_config.gen_ssh_key_pair | bool when: weechat.custom_config.gen_ssh_key_pair | bool
- name: print ssh public key to user - name: print ssh public key to user
pause: pause:
prompt: "Your ssh public key:\n\n{{ ssh_key_pair.public_key }}\n\n" prompt: |
We generated a new ssh key pair for you.
Please use the following public key as deployment key
to your private git repository with your own weechat config.
Private git repositorys are not public available and
you need some sort of authorisation method to verify
that you are allowed to clone your private repo.
Your ssh public key come here...
{{ ssh_key_pair.public_key }}
Please be aware, that this role do not commit or
push any local changes and you have to do this
manually by yourself.
when: when:
- weechat.custom_config.gen_ssh_key_pair | bool - weechat.custom_config.gen_ssh_key_pair | bool
- ssh_key_pair.changed - ssh_key_pair.changed