From d0a835a44b3fd25267c3c8c6d3ed12e1e628816b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 13 Nov 2018 01:00:51 +0100 Subject: [PATCH] Use variables to fill gpg information --- roles/gnupg/handlers/main.yml | 2 +- site.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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: -- 2.41.0