@ahaw021
Im run my playbook via ansible:
ansible-playbook -i inventories/develop/ cloud_playbooks/certbot-auto.yml
As example, i have DNS name and service on consul.woinc.space
My Nginx Frontend servers have a acme challenges for that domain on each server:
Ansible Inventory location example for consul.woinc.space -
location_consul:
- location / {
proxy_pass http://consul_{{ ansible_environment }};
}
- location ^~ /.well-known/acme-challenge/ {
alias /opt/certbot-auto/web/.well-known/acme-challenge/;
}
I have 5 nginx frontend server with 5 public real records, you can DIG example by link
(dig)[https://toolbox.googleapps.com/apps/dig/#A/consul.woinc.space]
certbot.yml playbook
- name: fact gathering
hosts: all
tasks: []
tags: [get_facts, always]
- name: Update LetsEncrypt Certs
hosts: nginx-frontend
serial: 1
become: true
roles:
- certbot-auto
i’m run in role, main task which provide errors for next processing.
- name: Generate Certificates by Certbot
shell: "{{ certbot_auto_settings.directories.main }}/certbot-auto certonly --agree-tos --email ros@woinc.ru --webroot -w {{ certbot_auto_settings.directories.webdir }} -d {{ item.name | join }} --noninteractive"
register: certbot_generate_status
with_items: "{{ pass_dict }}"
Only one server from the list for each domain name correctly completes the certificate issuance process.
As example i have 3 domains
consul.woinc.space
powerdns.woinc.space
cp.woinc.space
and i want to get a certificates for each domain on each server:
- Each domain from list nave 5 public IP addresses, which lead to nginx-frontend IPs
- Each server from nginx-frontend have available site for each domain and have correct acme (dirs, settings - because settings setup same for all via ansible)
- Each server run command to regenerate/renew/issuing a certificate: {{ certbot_auto_settings.directories.main }}/certbot-auto certonly --agree-tos --email ros@woinc.ru --webroot -w {{ certbot_auto_settings.directories.webdir }} -d {{ item.name | join }} --noninteractive
Only one server from list correct the proccess for each domain name.
As example result everytime i see, something like this:
DOMAIN1:
server1 correct done process for domain1
other servers give the errors for this domain
DOMAIN2:
server3 correct done process for domain2
other servers give the errors for this domain
DOMAIN3:
server5 correct done process for domain3
other servers give the errors for this domain
May be possible workaround for this?
I really don’t understand what i need to redirect to “main server”? What a main server? All servers a “main server” with separated acme challenge directory. And if i run my playbook multiple times, other servers done process then in first time run. Every time success result produced on random server. I think its not correct.
Or i need the network share or sync for acmes folders for able all servers have a same acme challenges?
My imho, which certbot provide the request to issue/renew a certificate to acme server, acme server go to DNS lookup the IP for that request and get some IP from list and go to him with acme answer, and as result certbot server and client have requests and answers mismatch.
May be the acme bot which provide the ACME answers for ACME client, can possible to extend feature what can to determinate all public IP of the server and send ACME answer to each Public IP or to needed server.
As example, ssllabs ssl server check, which determinate all public IP for domain and perform check for each IP.
Thanks