]> git.immae.eu Git - perso/Immae/Config/Ansible.git/commitdiff
Use variables to fill gpg information
authorIsmaël Bouya <ismael.bouya@fretlink.com>
Tue, 13 Nov 2018 00:00:51 +0000 (01:00 +0100)
committerIsmaël Bouya <ismael.bouya@fretlink.com>
Tue, 13 Nov 2018 00:00:51 +0000 (01:00 +0100)
roles/gnupg/handlers/main.yml
site.yml

index d32d321d0e66748fc0b115193e3e8cd3abfe49ab..7dc34c710538e038dd60a6dbbc6c75f2d7a3a4fd 100644 (file)
@@ -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 <key> <key>. Press key when done"
index c022b973b41666d705d7fcfb69ba1d6a534deda9..6e73ae355b31d924cf372f20a152d7494cf443f6 100644 (file)
--- 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: