community.crypto.split_pem (2.18.0) — filter

Split PEM file contents into multiple objects

| "added in version" 2.10.0 of community.crypto"

Authors: Felix Fontein (@felixfontein)

Install collection

Install with ansible-galaxy collection install community.crypto:==2.18.0


Add to requirements.yml

  collections:
    - name: community.crypto
      version: 2.18.0

Description

Split PEM file contents into multiple PEM objects. Comments or invalid parts are ignored.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print all CA certificates
  ansible.builtin.debug:
    msg: '{{ item }}'
  loop: >-
    {{ lookup('ansible.builtin.file', '/path/to/ca-bundle.pem') | community.crypto.split_pem }}

Inputs

    
_input:
    description:
    - The PEM contents to split.
    required: true
    type: string

Outputs

_value:
  description:
  - A list of PEM file contents.
  elements: string
  type: list