Files
computer-playbook/library/README.md
kevinveenbirkenbachandClaude Opus 4.7 79409ebf10 test(tooling): integrate markdownlint-cli2, ansible-lint, galaxy-importer + fix the resulting baseline
Tooling integration
* add .markdownlint-cli2.jsonc, .ansible-lint, .ansible-lint-ignore
  configs (permissive day-1: cosmetic rules disabled, semantic ones on)
* extend scripts/install/lint.sh with generic install_pip_pkg helper +
  ensure_ansible_lint / ensure_galaxy_importer / ensure_markdownlint_cli2
  ensure_* functions (pip / npm with sudo / --user / --break-system-packages
  fallbacks). install_ansible_tools now also pulls ansible-lint and
  galaxy-importer; new `markdown` install group.
* extend scripts/lint/ansible.sh to run ansible-lint after the existing
  syntax-check.
* add scripts/lint/markdown.sh and scripts/lint/galaxy.sh runners. The
  galaxy runner parallelizes via xargs (-P=$(nproc)), prints OK/FAIL per
  role, and treats `bare-name dependency` errors as success since our
  roles/ tree is not a Galaxy collection layout. All other Galaxy schema
  errors still fail.
* Makefile: new lint-markdown and lint-galaxy targets, both wired into
  `make lint`.
* CI: new workflows lint-markdown.yml and lint-galaxy.yml; lint-ansible.yml
  now installs ansible-core + ansible-lint; ci-orchestrator wires both
  new lint workflows into lint-gate.

Galaxy schema fixes
* shorten the canonical `galaxy_info.company` block from three lines to
  two ("Kevin Veen-Birkenbach\nhttps://www.veen.world", 45 chars) so it
  stays under Galaxy's hard 50-char limit. Updated everywhere: 229 role
  meta/main.yml plus _CANONICAL_COMPANY in
  tests/lint/repository/test_role_meta_main_galaxy_schema.py.
* shorten 19 over-long role descriptions to <=255 chars.
* add stub READMEs for sys-svc-compose-ca and sys-utils-service-loader.

Markdown baseline fixes
* markdownlint-cli2 --fix run repo-wide (formatting normalization
  across CHANGELOG, role READMEs, docs).
* manual MD041 fixes: prepend H1 in 15 files (CHANGELOG, LICENSE,
  TODO.md helpers, role README templates, etc.).
* MD025 / MD003 / MD001 / MD032 manual fixes for heading-style and
  list-spacing edge cases.
* role README content polish: "## Single Point of Truth (SPOT)" headings
  renamed to "## User data resolution" (D3 self-label rule).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 23:46:37 +02:00

53 lines
1.5 KiB
Markdown

# Custom Modules (`library/`)
This directory contains project-specific Ansible modules used by Infinito.Nexus.
## What Belongs Here
Use `library/` for idempotent module logic that represents concrete automation actions.
Typical cases:
- managing resources that have no suitable built-in/community module,
- wrapping internal APIs or internal infrastructure semantics,
- implementing reusable module interfaces for role/playbook consumption.
## What Does Not Belong Here
- Shared helper code used by multiple modules/plugins goes to `utils/`.
- Jinja transformations belong to `plugins/filter/`.
- Runtime value retrieval belongs to `plugins/lookup/`.
- Task execution wrappers belong to `plugins/action/`.
## Usage
Ansible searches `library/` for custom modules. In playbooks, call them like built-in modules.
```yaml
- name: Run a custom Infinito module
infinito_custom_module:
option_one: value
option_two: value
```
## Implementation Notes
- Keep modules idempotent and predictable.
- Validate input early and return structured failure messages.
- Move duplicated helpers into `utils/`.
### Shebang Requirement for Custom Modules
Files in `library/` should use:
```python
#!/usr/bin/python
```
Ansible rewrites this interpreter path to the configured host interpreter for module execution.
## References
- Developing modules: <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules.html>
- Module utilities: <https://docs.ansible.com/ansible/latest/dev_guide/developing_module_utilities.html>