Created
October 6, 2020 06:51
-
-
Save tonk/7aaf073db77816f9cc02f8dced8fc138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- import_playbook: setup_tpm.yml | |
tags: always | |
- hosts: all | |
gather_facts: true | |
become: true | |
tasks: | |
- name: grab needed passwords from tpm | |
set_fact: | |
backup_passwd: "{{ lookup('tpmstore', | |
tpm_url, | |
'root@backup1.example.net', | |
tpm_public_key, | |
tpm_private_key, | |
tpm_certificate, | |
tpm_certificate_key) }}" | |
tags: always | |
- name: show it | |
debug: | |
msg: "backup: {{ backup_passwd }}" | |
- name: Check if backup rsync keys present | |
tags: backup, backup_keys | |
vars: | |
ansible_become_method: su | |
ansible_su_pass: "{{ backup_passwd }}" | |
delegate_to: backup1.example.net | |
command: "ls -l /backup/keys/{{ ansible_facts['hostname'] }}" | |
register: backup_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment