mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.7 KiB
YAML
83 lines
2.7 KiB
YAML
6 years ago
|
---
|
||
|
- name: Generate account key
|
||
|
command: openssl ecparam -name prime256v1 -genkey -out {{ output_dir }}/accountkey.pem
|
||
|
|
||
|
- name: Generate second account key
|
||
|
command: openssl ecparam -name prime256v1 -genkey -out {{ output_dir }}/accountkey2.pem
|
||
|
|
||
|
- name: Parse account key (to ease debugging some test failures)
|
||
|
command: openssl ec -in {{ output_dir }}/accountkey.pem -noout -text
|
||
|
|
||
|
- name: Check that account does not exist
|
||
6 years ago
|
acme_account_info:
|
||
6 years ago
|
select_crypto_backend: "{{ select_crypto_backend }}"
|
||
|
account_key_src: "{{ output_dir }}/accountkey.pem"
|
||
|
acme_version: 2
|
||
|
acme_directory: https://{{ acme_host }}:14000/dir
|
||
|
validate_certs: no
|
||
|
register: account_not_created
|
||
|
|
||
|
- name: Create it now
|
||
|
acme_account:
|
||
|
select_crypto_backend: "{{ select_crypto_backend }}"
|
||
|
account_key_src: "{{ output_dir }}/accountkey.pem"
|
||
|
acme_version: 2
|
||
|
acme_directory: https://{{ acme_host }}:14000/dir
|
||
|
validate_certs: no
|
||
|
state: present
|
||
|
allow_creation: yes
|
||
|
terms_agreed: yes
|
||
|
contact:
|
||
|
- mailto:example@example.org
|
||
|
|
||
|
- name: Check that account exists
|
||
6 years ago
|
acme_account_info:
|
||
6 years ago
|
select_crypto_backend: "{{ select_crypto_backend }}"
|
||
|
account_key_src: "{{ output_dir }}/accountkey.pem"
|
||
|
acme_version: 2
|
||
|
acme_directory: https://{{ acme_host }}:14000/dir
|
||
|
validate_certs: no
|
||
|
register: account_created
|
||
|
|
||
|
- name: Clear email address
|
||
|
acme_account:
|
||
|
select_crypto_backend: "{{ select_crypto_backend }}"
|
||
|
account_key_content: "{{ lookup('file', output_dir ~ '/accountkey.pem') }}"
|
||
|
acme_version: 2
|
||
|
acme_directory: https://{{ acme_host }}:14000/dir
|
||
|
validate_certs: no
|
||
|
state: present
|
||
|
allow_creation: no
|
||
|
contact: []
|
||
|
|
||
|
- name: Check that account was modified
|
||
6 years ago
|
acme_account_info:
|
||
6 years ago
|
select_crypto_backend: "{{ select_crypto_backend }}"
|
||
|
account_key_src: "{{ output_dir }}/accountkey.pem"
|
||
|
acme_version: 2
|
||
|
acme_directory: https://{{ acme_host }}:14000/dir
|
||
|
validate_certs: no
|
||
|
account_uri: "{{ account_created.account_uri }}"
|
||
|
register: account_modified
|
||
|
|
||
|
- name: Check with wrong account URI
|
||
6 years ago
|
acme_account_info:
|
||
6 years ago
|
select_crypto_backend: "{{ select_crypto_backend }}"
|
||
|
account_key_src: "{{ output_dir }}/accountkey.pem"
|
||
|
acme_version: 2
|
||
|
acme_directory: https://{{ acme_host }}:14000/dir
|
||
|
validate_certs: no
|
||
|
account_uri: "{{ account_created.account_uri }}test1234doesnotexists"
|
||
|
register: account_not_exist
|
||
|
|
||
|
- name: Check with wrong account key
|
||
6 years ago
|
acme_account_info:
|
||
6 years ago
|
select_crypto_backend: "{{ select_crypto_backend }}"
|
||
|
account_key_src: "{{ output_dir }}/accountkey2.pem"
|
||
|
acme_version: 2
|
||
|
acme_directory: https://{{ acme_host }}:14000/dir
|
||
|
validate_certs: no
|
||
|
account_uri: "{{ account_created.account_uri }}"
|
||
|
ignore_errors: yes
|
||
|
register: account_wrong_key
|