[ansible-project] Help with acme_certificate / letsencrypt and empty challenge_data

2022-01-18 Thread Jason Wood
I'm fairly new to this. I'm using ansible 2.9.6 on Ubuntu 20.04. I followed the Digital Ocean tutorial to get started with letsencrypt/acme_certificate The problem I run

Re: [ansible-project] Help with acme_certificate / letsencrypt and empty challenge_data

2022-01-18 Thread Jason Wood
inventory_hostname is not the domain, it is a variable which contains the domain. That's the part where I'm not sure how to reference it. I will try upgrading to see if that changes anything. Thanks! On Tuesday, January 18, 2022 at 12:03:31 p.m. UTC-5 Felix Fontein wrote: > Hi, > > > I'm fairly

Re: [ansible-project] Help with acme_certificate / letsencrypt and empty challenge_data

2022-01-18 Thread Jason Wood
tains name of the host for which task or play runs That is exactly what I want and it seems to be working as I expect. Notice the true result from my second debug task above. I also know through debug that inventory_hostname contains the domain I want the certificate issued for. I also debug th

Re: [ansible-project] Help with acme_certificate / letsencrypt and empty challenge_data

2022-01-18 Thread Jason Wood
oh my! Thank you!!! It appears that the first example in the docs has this error: https://docs.ansible.com/ansible/latest/collections/community/crypto/acme_certificate_module.html#acme-certificate-module So with that solved, I'm left with the problem where challenge_data is empty even if I spec

[ansible-project] Install lxml for community.general.xml

2022-01-19 Thread Jason Wood
I am running Ansible on Ubuntu 20.04. I'd like to use the community.general.xml module. I get a "ModuleNotFoundError" relating to lxml when I try to run the playbook. I tried sudo apt-get install python3-lxml There were errors toward the end of the process: ... Setting up ansible (5.2.0-1ppa~

Re: [ansible-project] Help with acme_certificate / letsencrypt and empty challenge_data

2022-01-19 Thread Jason Wood
Thanks - I'm understanding much better now. The presence of challenge data is not necessarily required for certificate renewal, if previous challenge data is still valid, you can just skip the copy step and the second run will install a new certificate. If no certificate is needed because remai

[ansible-project] Better way to reference SSH Identity Key?

2022-01-26 Thread Jason Wood
Right now I have in ansible.cfg: [ssh_connection] ssh_args = -F ssh_config scp_if_ssh = True And in ssh_config: Host sub.domain.com Hostname sub.domain.com User ubuntu IdentityFile ~/mykeyfile.pem Right now I'm manually editing this file to change the 2 hostnames when I want to wor

Re: [ansible-project] Better way to reference SSH Identity Key?

2022-01-28 Thread Jason Wood
Thank you both. I'm going with the [defaults] private_key_file = ~/mykeyfile.pem method, but it's good to know that this can also be done inside the playbook, as I might want to consider using ansible for key rotation at some point in the future... Thanks again. Jason On Wednesday, Januar

[ansible-project] Identify most recent directory in a directory.

2022-12-01 Thread Jason Wood
After performing a shell script, a new directory is created and I need to work with that directory, but I don't know the name. How can I get the name of the most recent directory created? The name will be formatted like 2022-12-01_1702, so the directory I need will be the last if sorted alphanu