From dfd05afe7215e75ba2d34cc4cbc73ed8e10452bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 19 Nov 2018 08:10:23 +0100 Subject: Change gpg sign id --- roles/git/templates/config.j2 | 2 +- roles/gnupg/files/gnupg/gpg.conf | 7 ------- roles/gnupg/tasks/main.yml | 5 ++++- roles/gnupg/templates/gpg.conf.j2 | 7 +++++++ site.yml | 1 + 5 files changed, 13 insertions(+), 9 deletions(-) delete mode 100644 roles/gnupg/files/gnupg/gpg.conf create mode 100644 roles/gnupg/templates/gpg.conf.j2 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/files/gnupg/gpg.conf b/roles/gnupg/files/gnupg/gpg.conf deleted file mode 100644 index 17bc522..0000000 --- a/roles/gnupg/files/gnupg/gpg.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Main signing key -default-key DB1CFE90 - -default-recipient-self -encrypt-to 0326A611 -auto-key-retrieve -no-greeting 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/templates/gpg.conf.j2 b/roles/gnupg/templates/gpg.conf.j2 new file mode 100644 index 0000000..a967080 --- /dev/null +++ b/roles/gnupg/templates/gpg.conf.j2 @@ -0,0 +1,7 @@ +# Main signing key +default-key {{ gpg_sign_id }} + +default-recipient-self +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" -- cgit v1.2.3