Dotfiles/setup/modules/FreeipaAnsible/ansible/policies.d
Amir Alexander Abdelbaki b21f415cde fix(ansipa): hostname-binary-free FQDN + push-mode orchestration (NAT path)
Found while running the policy matrix and NAT/WAN scenario in VMs:

- ansipa-enforce-policies.sh and the dev_security-scan generated script called
  `hostname -f`, but the hostname binary (inetutils) is not installed on a
  minimal Arch system, so the enforcer aborted with "hostname: command not
  found" on every run. Add an ansipa_fqdn() helper (hostnamectl / getent /
  /etc/hostname / kernel-hostname fallback chain) and use it; inline the same
  fallback in the standalone scan script.

- Fix two stacked bugs that meant CheckMK push mode — the only monitoring
  transport that works when a client is behind NAT — never functioned:
  * ansipa-checkmk-setup.sh referenced IPA_ADMIN_PASS in the DONE_FLAG
    early-exit path, but that variable was assigned only afterwards, so every
    rerun kinit'd with an empty password, failed silently, and skipped the
    push-mode request writer. Resolve config before the early exit.
  * _write_push_requests parsed `ipa hostgroup-show dev_mon_base` members with
    awk that did `next` on the "Member hosts:" line — but ipa prints members on
    that same line, so the only line with hostnames was discarded and no push
    request was ever written. Rewrite the awk to capture the label line's value
    plus wrapped continuation lines. Verified end-to-end: requests are written
    and CheckMK flips the host to cmk_agent_connection=push-agent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUhrcFU8J1Hnf7vNqNxZNi
2026-07-02 12:25:03 +02:00
..
dev_daemon.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
dev_local-sudo.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
dev_mon.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
dev_no-local-users.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
dev_security-scan.sh fix(ansipa): hostname-binary-free FQDN + push-mode orchestration (NAT path) 2026-07-02 12:25:03 +02:00
dev_ssh.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
dev_timeshift-backup.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
usr_admin.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
usr_block-binary.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
usr_policystore.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
usr_prt.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
usr_scan-notify.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00
usr_smb.sh refactor(ansipa): split enforce-policies monolith into modular policies.d/ system 2026-07-01 19:27:35 +02:00