--- - name: Set up gpg hosts: localhost connection: local vars: uid: "{{ lookup('env', 'USER') }}" cert_test: "{{ lookup('ansible.builtin.pipe', 'pass show kube1.drive.test.sunet.se/cert') }}" token_test: "{{ lookup('ansible.builtin.pipe', 'pass show kube1.drive.test.sunet.se/token') }}" cert_prod: "{{ lookup('ansible.builtin.pipe', 'pass show kube1.drive.sunet.se/cert') }}" token_prod: "{{ lookup('ansible.builtin.pipe', 'pass show kube1.drive.sunet.se/token') }}" become: false tasks: - name: Add gnupg conf dir ansible.builtin.file: dest: /home/{{ uid }}/.gnupg state: directory - name: Add kube.conf ansible.builtin.template: src: ../templates/gpg-agent.conf.j2 dest: /home/{{ uid }}/.gnupg/gpg-agent.conf