mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
sys-pip-install passes package_name straight to ansible.builtin.pip and defaults package_state to latest, so a bare name pulled whatever PyPI served that day and nothing in the repository recorded which version a host ended up with. svc-bkp-volume-2-local already pins this way. A version inside the name is compatible with state=latest: the pip module rejects only the separate version parameter, its guard reads 'state == latest and version is not None', so this resolves as pip install -U automtu==1.1.1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
---
|
|
- name: 📦 Install automtu via pip (system-wide)
|
|
include_role:
|
|
name: sys-pip-install
|
|
vars:
|
|
package_name: "automtu==1.1.1"
|
|
global_install: true
|
|
|
|
- name: ✅ Ensure 'ip' and 'ping' commands are available for automtu
|
|
package_install:
|
|
id:
|
|
- iproute
|
|
- iputils-ping
|
|
|
|
- name: 🔍 Detect safe Docker MTU
|
|
ansible.builtin.command:
|
|
argv:
|
|
- "{{ ansible_python_interpreter }}"
|
|
- -m
|
|
- automtu
|
|
- --pmtu-target
|
|
- "{{ SYS_SVC_DOCKER_AUTOMTU_TARGETS | join(',') }}"
|
|
- --pmtu-policy
|
|
- min
|
|
- --print-mtu
|
|
- effective
|
|
register: automtu_mtu
|
|
changed_when: false
|
|
|
|
- name: ✅ Assert automtu returned an integer MTU
|
|
ansible.builtin.assert:
|
|
that:
|
|
- automtu_mtu.stdout is match('^[0-9]+$')
|
|
- (automtu_mtu.stdout | int) >= 576
|
|
- (automtu_mtu.stdout | int) <= 9000
|
|
fail_msg: "automtu returned unexpected MTU output: '{{ automtu_mtu.stdout | default('') }}'"
|
|
|
|
- name: 🔧 Set docker daemon MTU fact
|
|
ansible.builtin.set_fact:
|
|
SYS_DOCKER_DAEMONM_MTU: "{{ automtu_mtu.stdout | int }}"
|
|
changed_when: false
|