From: Ismaël Bouya Date: Tue, 13 Nov 2018 00:00:51 +0000 (+0100) Subject: Use variables to fill gpg information X-Git-Tag: v1.0~21 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FAnsible.git;a=commitdiff_plain;h=d0a835a44b3fd25267c3c8c6d3ed12e1e628816b Use variables to fill gpg information --- diff --git a/roles/gnupg/handlers/main.yml b/roles/gnupg/handlers/main.yml index d32d321..7dc34c7 100644 --- a/roles/gnupg/handlers/main.yml +++ b/roles/gnupg/handlers/main.yml @@ -9,7 +9,7 @@ prompt: "gpg key will be sent to immae.eu, please login to tmux and give passwords there." seconds: 3 - name: send key to immae@immae.eu - shell: "gpg --armor --export ismael@flony | ssh immae@immae.eu add_workstation_key | gpg --import -" + shell: "gpg --armor --export {{ gpg_useremail }} | ssh immae@immae.eu add_workstation_key | gpg --import -" - name: notify add key to password store pause: prompt: "Please add the key to the password store and push: pass init -p Folder/Folder . Press key when done" diff --git a/site.yml b/site.yml index c022b97..6e73ae3 100644 --- a/site.yml +++ b/site.yml @@ -1,10 +1,10 @@ --- - hosts: home vars: - gpg_useremail: "ismael@flony" + gpg_useremail: "{{ gpg_user }}@{{ ansible_hostname }}" gpg_realname: "Ismaël Bouya" - gpg_user: "ismael" - profile: "flony" + gpg_user: "{{ lookup('env', 'USER') }}" + profile: "{{ ansible_hostname }}" role: flony: "fretlink" features: