---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

####################################################################
# WARNING: These are designed specifically for Ansible tests       #
# and should not be used as examples of how to write Ansible roles #
####################################################################

- block:
  - name: Generate ECC256 account keys
    openssl_privatekey:
      path: "{{ remote_tmp_dir }}/account-ec256.pem"
      type: ECC
      curve: secp256r1
      force: true
  - name: Obtain cert 1
    include_tasks: obtain-cert.yml
    vars:
      select_crypto_backend: auto
      certgen_title: Certificate 1
      certificate_name: cert-1
      key_type: rsa
      rsa_bits: "{{ default_rsa_key_size_certificates }}"
      subject_alt_name: "DNS:example.com"
      subject_alt_name_critical: false
      account_key: account-ec256
      challenge: tls-alpn-01
      challenge_alpn_tls: acme_challenge_cert_helper
      modify_account: true
      deactivate_authzs: false
      force: false
      remaining_days: 10
      terms_agreed: true
      account_email: "example@example.org"

  when: cryptography_version.stdout is version('1.5', '>=')
