Testing Acme.sh with Ansible molecule

293 Views Asked by At

I have the following Ansible playbook to issue and install certificate:

- name: Issue certificate
  shell: acme.sh --issue --dns dns_acmeproxy -d {{ server_name }}

- name: Install certificate
  shell: >-
    acme.sh --dns dns_acmeproxy -d {{ server_name }}
    --install-cert
    --key-file "/etc/pki/tls/private/{{ server_name }}.key"
    --fullchain-file "/etc/pki/tls/certs/{{ server_name }}.crt"
    --reloadcmd "systemctl restart nginx"
  register: installcert
  failed_when: installcert.rc != 0

Is there a way to write Molecule converge test with using fake server_name or/and without calling ACME?

0

There are 0 best solutions below