Probably dirty but something like reading out the file and setting facts based on the line?
- name: Read certificate file
shell: cat {{ certdir }}/{{ zonefile }}-le.txt
register: cert_content
- name: Set cert variables from file
set_fact:
acmechallenge1: "{{ cert_content.stdout_lines[1] }}"
acmechallenge2: "{{ cert_content.stdout_lines[2] }}"
From: ansible...@googlegroups.com <ansible...@googlegroups.com>
On Behalf Of Dimitri Yioulos
Sent: Wednesday, March 6, 2024 2:09 PM
To: Ansible Project <ansible...@googlegroups.com>
Subject: [ansible-project] Parsing a local file to get variables
You don't often get email from dyio...@gmail.com. Learn why this is important |
Caution: This email originated from outside of the organisation. Do not click links or open attachments unless you recognise the sender and know the content is safe |
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ansible-proje...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/54de77a5-70fc-4b99-b240-ead1e7b09246n%40googlegroups.com.
Proud to be a certified B Corporation
This message is private and confidential. If you have received this message in error, please notify us and remove it from your system.
Zen Internet Limited may monitor email traffic data to manage billing, to handle customer enquiries, and for the prevention and detection of fraud. We may also monitor the content of emails sent to and/or
from Zen Internet Limited for the purposes of security, staff training and to monitor the quality of service.
Zen Internet Limited is registered in England and Wales, Sandbrook Park, Sandbrook Way, Rochdale, OL11 1RY Company No. 03101568 VAT Reg No. 686 0495 01