Updated RPM ansible

This commit is contained in:
Trial97
2021-06-30 14:20:56 +03:00
committed by Dan Christian Bogos
parent e9c75f2abf
commit 4c9113cf99

View File

@@ -1,4 +1,8 @@
---
- name: Restart gpg-agent
become: true
shell: "gpgconf --kill all"
- name: Ensure .gnupg config directory exists with right permissions
become: true
file: dest={{ gpg_home }}/.gnupg state=directory mode=0700 owner="{{ rootUser }}"
@@ -11,6 +15,19 @@
become: yes
become_user: "{{ rootUser }}"
register: gpgkeys
- name: Check expired keys
become: yes
shell: "gpg2 --list-keys {{ gpg_realname }} | grep 'expired'"
ignore_errors: yes
failed_when: false
register: gpgExpKeys
when: gpgkeys.stdout_lines|length > 0
- name: Update expired
become: yes
shell: 'printf "expire\n{{ gpg_expire }}\nsave\n" | gpg --batch --command-fd 0 --status-fd=2 --edit-key {{ gpg_realname }}'
when: gpgkeys.stdout_lines|length > 0 and gpgExpKeys.stdout_lines|length > 0
- include: gpg-gen-key.yaml
when: gpgkeys.stdout_lines|length < 1