openssl_csr
Generate or remove a certificate signing request on disk
Collection: community.crypto
Full Name: community.crypto.openssl_csr
Synopsis
Generate or remove a certificate signing request on disk
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| digest | string | sha256 | Pinned executable CSR argument (str source line 804) | |
| privatekey_path | string | Pinned executable CSR argument (path source line 805) | ||
| privatekey_content | string | Pinned executable CSR argument (str source line 806) | ||
| privatekey_passphrase | string | Pinned executable CSR argument (str source line 807) | ||
| version | int | 1 | Pinned executable CSR argument (int source line 808) | |
| subject | dict | Pinned executable CSR argument (dict source line 809) | ||
| subject_ordered | list | Pinned executable CSR argument (list source line 810) | ||
| country_name | string | Pinned executable CSR argument (str source line 811) | ||
| state_or_province_name | string | Pinned executable CSR argument (str source line 812) | ||
| locality_name | string | Pinned executable CSR argument (str source line 816) | ||
| organization_name | string | Pinned executable CSR argument (str source line 817) | ||
| organizational_unit_name | string | Pinned executable CSR argument (str source line 818) | ||
| common_name | string | Pinned executable CSR argument (str source line 822) | ||
| email_address | string | Pinned executable CSR argument (str source line 823) | ||
| subject_alt_name | list | Pinned executable CSR argument (list source line 824) | ||
| subject_alt_name_critical | bool | false | Pinned executable CSR argument (bool source line 829) | |
| use_common_name_for_san | bool | true | Pinned executable CSR argument (bool source line 834) | |
| key_usage | list | Pinned executable CSR argument (list source line 839) | ||
| key_usage_critical | bool | false | Pinned executable CSR argument (bool source line 840) | |
| extended_key_usage | list | Pinned executable CSR argument (list source line 845) | ||
| extended_key_usage_critical | bool | false | Pinned executable CSR argument (bool source line 850) | |
| basic_constraints | list | Pinned executable CSR argument (list source line 855) | ||
| basic_constraints_critical | bool | false | Pinned executable CSR argument (bool source line 860) | |
| ocsp_must_staple | bool | false | Pinned executable CSR argument (bool source line 865) | |
| ocsp_must_staple_critical | bool | false | Pinned executable CSR argument (bool source line 870) | |
| name_constraints_permitted | list | Pinned executable CSR argument (list source line 875) | ||
| name_constraints_excluded | list | Pinned executable CSR argument (list source line 876) | ||
| name_constraints_critical | bool | false | Pinned executable CSR argument (bool source line 877) | |
| create_subject_key_identifier | bool | false | Pinned executable CSR argument (bool source line 878) | |
| subject_key_identifier | string | Pinned executable CSR argument (str source line 879) | ||
| authority_key_identifier | string | Pinned executable CSR argument (str source line 880) | ||
| authority_cert_issuer | list | Pinned executable CSR argument (list source line 881) | ||
| authority_cert_serial_number | int | Pinned executable CSR argument (int source line 882) | ||
| crl_distribution_points | list | Pinned executable CSR argument (list source line 883) | ||
| select_crypto_backend | string | auto | Pinned executable CSR argument (str source line 908) | |
| state | string | present | Pinned executable CSR argument (str source line 329) | |
| force | bool | false | Pinned executable CSR argument (bool source line 334) | |
| path | string | yes | Pinned executable CSR argument (path source line 335) | |
| backup | bool | false | Pinned executable CSR argument (bool source line 336) | |
| return_content | bool | false | Pinned executable CSR argument (bool source line 337) | |
| mode | raw | Pinned executable CSR argument (raw source line 195) | ||
| owner | string | Pinned executable CSR argument (str source line 196) | ||
| group | string | Pinned executable CSR argument (str source line 197) | ||
| seuser | string | Pinned executable CSR argument (str source line 198) | ||
| serole | string | Pinned executable CSR argument (str source line 199) | ||
| selevel | string | Pinned executable CSR argument (str source line 200) | ||
| setype | string | Pinned executable CSR argument (str source line 201) | ||
| attributes | string | Pinned executable CSR argument (str source line 202) | ||
| unsafe_writes | bool | false | Pinned executable CSR argument (bool source line 203) |
Example
yaml
# Requirements: a Linux controller and one localhost inventory host, using --forks 1.
# The fresh /var/tmp/parallax-csr-file-profile directory must already be owned and writable.
# Its key.pem must already be an owned readable regular private key with mode 0600.
# request.csr is initially absent; this play requests mode 0600, without owner/group, SELinux or chattr changes.
# Use the supported native Go runtime with Go FIPS mode disabled.
# The shipped CPython64/seed0 JSON compatibility model needs no Python installation or PYTHONHASHSEED setting.
# Use 1-16 homogeneous file CSR tasks with literal no_log: true and the same valid literal register csr.
# Do not mix helper tasks, pipe CSR tasks, loops, delegation, roles, handlers or task/play environments.
# SSH, multiple hosts, general provider/filesystem parity and crash-consistent rollback are outside this profile.
# Codec/resource/native-provider limits fail closed; private source values are opaque to ordinary debug.
- name: Generate a private local file certificate signing request
hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Generate a private certificate signing request on disk
community.crypto.openssl_csr:
path: /var/tmp/parallax-csr-file-profile/request.csr
privatekey_path: /var/tmp/parallax-csr-file-profile/key.pem
common_name: example.test
mode: '0600'
no_log: true
register: csr