No description
Find a file
Mark van Huijstee 3c20fce05d
Merge pull request #64 from de-it-krachten/dev
Update supported platforms & CI (2026-06-07)
2026-06-08 11:10:55 +02:00
.github/workflows feat: Support ansible-core 2.20 2026-05-23 13:21:51 +02:00
defaults Fix facts_venv 2026-05-25 17:24:26 +02:00
handlers feat: Update CI to latest standards 2022-10-10 08:58:57 +02:00
meta feat: Add support for kernel module facts (lsmod) 2026-05-11 18:40:15 +02:00
molecule/default Fix RHEL10 packages 2026-05-25 17:14:24 +02:00
tasks Fix RHEL10 packages 2026-05-25 17:14:24 +02:00
templates feat: Add support for kernel module facts (lsmod) 2026-05-11 18:40:15 +02:00
.ansible-lint feat: Add support for kernel module facts (lsmod) 2026-05-11 18:40:15 +02:00
.cicd feat: Support ansible-core 2.20 2026-05-23 13:21:51 +02:00
.cicd.overwrite feat: Add support for kernel module facts (lsmod) 2026-05-11 18:40:15 +02:00
.collections fix: Fix support for kernel module facts (lsmod) 2026-05-11 23:09:28 +02:00
.gitignore Delete '.ansible' from git 2025-08-04 21:58:24 +02:00
.releaserc.yml Update CI 2026-03-06 22:36:00 +01:00
.roles feat: Add support for kernel module facts (lsmod) 2026-05-11 18:40:15 +02:00
.yamllint feat: Update supported platforms & CI 2024-12-29 01:57:50 +01:00
CHANGELOG.md chore(release): 1.19.2 [skip ci] 2026-05-25 12:40:30 +00:00
README.md Update CI 2026-06-07 16:50:56 +02:00

CI

ansible-role-facts

Provisions custom facts and runs setup optionally

Dependencies

Roles

  • deitkrachten.epel
  • deitkrachten.python

Collections

  • ansible.windows
  • community.general

Platforms

Supported platforms

  • Red Hat Enterprise Linux 81
  • Red Hat Enterprise Linux 91
  • Red Hat Enterprise Linux 101
  • RockyLinux 8
  • RockyLinux 9
  • RockyLinux 10
  • OracleLinux 8
  • OracleLinux 9
  • OracleLinux 10
  • AlmaLinux 8
  • AlmaLinux 9
  • AlmaLinux 10
  • Debian 11 (Bullseye)
  • Debian 12 (Bookworm)
  • Debian 13 (Trixie)
  • Ubuntu 20.04 LTS
  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS
  • Ubuntu 26.04 LTS
  • Fedora 43
  • Fedora 441
  • Alpine 3
  • Windows Server 2012 R21
  • Windows Server 20161
  • Windows Server 20191
  • Windows Server 20221
  • Windows Server 20251

Note: 1 : no automated testing is performed on these platforms

Role Variables

defaults/main.yml


# OS-oriented defaults
__facts_os_defaults:
  default:
    # facts location
    facts_path: /etc/ansible/facts.d

    # list of defaults facts to distribute
    # Possible attributes : name, groups (default=all), os (default=all), os_family (default=all)
    # groups, os and os_family should be lists
    facts_custom:
      - name: kernel
      - name: users
      - name: users_ext
      - name: groups
      - name: groups_ext
      - name: repolist
        os_family: [ 'RedHat' ]
      - name: cpu
      - name: scsi
      - name: mapper
      - name: platform
      - name: lsmod

    facts_packages:
      - kmod

    # List of tools to install in python venv
    facts_venv:
      - name: jc
        packages:
          - jc

    # Additional facts to distribute
    facts_custom_additional: "{{ custom_facts_additional | default([]) }}"

    # Run setup when facts change
    facts_run_setup: true

    # Execute setup in all cases
    facts_force_run_setup: false

  'family-Debian':
    # List of packages required to custom facts
    facts_packages:
      - kmod
      - python3-venv
  'family-Windows':
    # facts location
    facts_path: c:\temp\facts

    # list of defaults facts to distribute
    # Possible attributes : name, groups (default=all), os (default=all), os_family (default=all)
    # groups, os and os_family should be lists
    facts_custom:
      - disks_custom
      - platform
    # customer facts to distribute
    facts_custom_additional: "{{ custom_facts_additional | default([]) }}"
    # Run setup when facts change
    facts_run_setup: true
  'RedHat-10':
    facts_packages:
      - kmod
      - python3-packaging

# OS key helpers
__facts_distro: "{{ ansible_facts.distribution }}"
__facts_os_family: "{{ ansible_facts.os_family }}"
__facts_distro_version: "{{ __facts_distro }}-{{ ansible_facts.distribution_major_version }}"
__facts_os_version: "{{ __facts_os_family }}-{{ ansible_facts.distribution_major_version }}"

# Construct defaults in the corrct order
__facts_os: >-
  {{
    __facts_os_defaults['default'] | default({}) |
    combine(__facts_os_defaults['family-'+__facts_os_family] | default({})) |
    combine(__facts_os_defaults['family-'+__facts_os_version] | default({})) |
    combine(__facts_os_defaults[__facts_distro] | default({})) |
    combine(__facts_os_defaults[__facts_distro_version] | default({}))
  }}

# Public variables — all lazy, all overridable
facts_custom: "{{ __facts_os.facts_custom }}"
facts_custom_additional: "{{ __facts_os.facts_custom_additional }}"
facts_packages: "{{ __facts_os.facts_packages }}"
facts_path: "{{ __facts_os.facts_path }}"
facts_run_setup: "{{ __facts_os.facts_run_setup }}"
facts_force_run_setup: "{{ __facts_os.facts_force_run_setup }}"
facts_venv: "{{ __facts_os.facts_venv }}"

Example Playbook

molecule/default/converge.yml


- name: sample playbook for role 'facts'
  hosts: all
  become: 'yes'
  tasks:
    - name: Include role 'facts'
      ansible.builtin.include_role:
        name: facts
- name: sample playbook for role 'facts' post playbook
  ansible.builtin.import_playbook: converge-post.yml
  when: molecule_converge_post is undefined or molecule_converge_post | bool