From dfd05afe7215e75ba2d34cc4cbc73ed8e10452bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 19 Nov 2018 08:10:23 +0100 Subject: [PATCH] Change gpg sign id --- roles/git/templates/config.j2 | 2 +- roles/gnupg/tasks/main.yml | 5 ++++- roles/gnupg/{files/gnupg/gpg.conf => templates/gpg.conf.j2} | 4 ++-- site.yml | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) rename roles/gnupg/{files/gnupg/gpg.conf => templates/gpg.conf.j2} (55%) diff --git a/roles/git/templates/config.j2 b/roles/git/templates/config.j2 index 7182626..f723f33 100644 --- a/roles/git/templates/config.j2 +++ b/roles/git/templates/config.j2 @@ -1,5 +1,5 @@ [user] - signingkey = DC384748709D2619FF2867216D0CAFFDDB1CFE90 + signingkey = {{ gpg_sign_id }} {% if profile in role and role[profile] == "fretlink" %} email = ismael.bouya@fretlink.com {% else %} diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml index bfbf31a..5139bef 100644 --- a/roles/gnupg/tasks/main.yml +++ b/roles/gnupg/tasks/main.yml @@ -12,7 +12,10 @@ dest: "$XDG_CONFIG_HOME/gnupg/{{ item }}" loop: - gpg-agent.conf - - gpg.conf +- name: gpg config file + template: + src: "gpg.conf.j2" + dest: "$XDG_CONFIG_HOME/gnupg/gpg.conf" - name: Get gnupg runtime folder name shell: 'gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"' register: gnupg_runtime_dir_cmd diff --git a/roles/gnupg/files/gnupg/gpg.conf b/roles/gnupg/templates/gpg.conf.j2 similarity index 55% rename from roles/gnupg/files/gnupg/gpg.conf rename to roles/gnupg/templates/gpg.conf.j2 index 17bc522..a967080 100644 --- a/roles/gnupg/files/gnupg/gpg.conf +++ b/roles/gnupg/templates/gpg.conf.j2 @@ -1,7 +1,7 @@ # Main signing key -default-key DB1CFE90 +default-key {{ gpg_sign_id }} default-recipient-self -encrypt-to 0326A611 +encrypt-to {{ gpg_sign_id }} auto-key-retrieve no-greeting diff --git a/site.yml b/site.yml index 6e73ae3..9010737 100644 --- a/site.yml +++ b/site.yml @@ -4,6 +4,7 @@ gpg_useremail: "{{ gpg_user }}@{{ ansible_hostname }}" gpg_realname: "Ismaël Bouya" gpg_user: "{{ lookup('env', 'USER') }}" + gpg_sign_id: "F82806FDA1BF5B9A1B3014E7C9FCED6CA6B79454" profile: "{{ ansible_hostname }}" role: flony: "fretlink" -- 2.41.0