Skip to content

Instantly share code, notes, and snippets.

View felixfontein's full-sized avatar

Felix Fontein felixfontein

View GitHub Profile

Docs presentation

  • public Ansible docsite

  • setup venv and install ansible-core and antsibull-docs in there

    $ python -m venv ~/antsibull-demo-venv
    $ . ~/antsibull-demo-venv/bin/activate
@felixfontein
felixfontein / antsibull-demo.sh
Created April 12, 2022 12:29
antsibull-docs demo
# Create and activate Python virtual environment
python3 -m venv antsibull-test
cd antsibull-test
. bin/activate
# Install ansible-core and antsibull-docs
pip install ansible-core antsibull-docs
# Create collection directory
mkdir collections
@felixfontein
felixfontein / deprecation-in-collections.md
Last active September 12, 2020 21:32
Deprecation in Collections and Ansible 2.10+

The collection name used in ansible/ansible is ansible.builtin.

  1. Module/plugin deprecation:
    • deprecated entry in DOCUMENTATION with:
      • why, alternative (required)
      • either removed_in: <version> or removed_at_date: <date>
      • (removed_from_collection is automatically inserted if not present)
    • deprecation entry in meta/runtime.yml with:
      • warning_text (optional)
  • either removal_version: or removal_date:
@felixfontein
felixfontein / objects.py
Last active April 6, 2019 10:15
Create _OID_MAP for Ansible's module_utils/crypto.py from OpenSSL's objects.txt
#!/usr/bin/python
import re
OIDs = dict()
names_lookup = dict()
def convert_for_lookup(name):
return name.replace('-', '_')
# Can be used in an Ansible module to check whether a certificate is revoked using OCSP.
# Needs filenames of certificate and intermediate certificate.
import base64
import os
import re
import tempfile
import traceback
from ansible.module_utils.basic import AnsibleModule