---
- name: Test issuing certificate with certmonger provider
  hosts: all
  vars:
    certificate_requests:
      - name: mycert_provider
        dns: www.example.com
        ca: self-sign
        provider: certmonger
  roles:
    - linux-system-roles.certificate

- name: Verify certificate
  hosts: all
  vars:
    certificates:
      - path: /etc/pki/tls/certs/mycert_provider.crt
        key_path: /etc/pki/tls/private/mycert_provider.key
        subject:
          - name: commonName
            oid: 2.5.4.3
            value: www.example.com
        subject_alt_name:
          - name: DNS
            value: www.example.com
  tasks:
    - name: Verify each certificate
      include_tasks: tasks/assert_certificate_parameters.yml
      loop: "{{ certificates }}"
      loop_control:
        loop_var: cert
