mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Add tests/lint/repository/test_task_file_numbering.py: numbered task files use exactly two leading digits, a numbered *_core.yml must be 00_core.yml, per directory the numbers are unique/consecutive and start at 01 (00 with a core file), numbered includes appear in ascending order, and shared helpers live in tasks/utils/ instead of the numbered chain. Apply it across every role: rename NN_core.yml to 00_core.yml with a consecutive down-shift of the siblings, move letter-suffix children into a subdirectory named after their parent task, relocate helpers included from more than one place into tasks/utils/, and update every reference (include_tasks, path_absolute, .ansible-lint-ignore, requirement docs). Legacy narration comments in the touched files are deleted; the upstream xwiki.properties reference block opts out via nocheck. The unused MAILU_IP6_PUBLIC var (only ever named in now-removed comments) is dropped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
58 lines
2.6 KiB
YAML
58 lines
2.6 KiB
YAML
---
|
|
- name: "🔨 Build list of modules to install"
|
|
set_fact:
|
|
odoo_modules_to_install: "{{ (ODOO_MODULES_CORE + ODOO_MODULES_OPTIONAL) | join(',') }}"
|
|
|
|
- name: "⏸️ Pause Odoo crons for the module install/update window"
|
|
database_query:
|
|
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
|
config: "{{ lookup('database', application_id) }}"
|
|
query_file: "{{ role_path }}/files/sql/update/ir-cron/pause.sql"
|
|
changed_when: true
|
|
|
|
- name: "📦 Run module install/update with crons paused"
|
|
block:
|
|
- name: "📦 Load module operations"
|
|
include_tasks: 03_install_modules/module_ops.yml
|
|
always:
|
|
- name: "▶️ Resume Odoo crons after the module window"
|
|
database_query:
|
|
mask_values: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
|
config: "{{ lookup('database', application_id) }}"
|
|
query_file: "{{ role_path }}/files/sql/update/ir-cron/resume.sql"
|
|
changed_when: true
|
|
|
|
- name: "📝 Flag Odoo for an offline `-u all` on the next boot"
|
|
ansible.builtin.shell: > # nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node
|
|
container exec {{ ODOO_LOCAL_CID | quote }} touch {{ ODOO_UPDATE_MARKER | quote }}
|
|
delegate_to: "{{ ODOO_HOST_NODE }}"
|
|
changed_when: true
|
|
|
|
- name: "♻️ Restart Odoo so the entrypoint runs `-u all` as the sole DB actor (compose)"
|
|
ansible.builtin.command: container restart {{ ODOO_CONTAINER }}
|
|
changed_when: true
|
|
when: DEPLOYMENT_MODE == 'compose'
|
|
|
|
- name: "♻️ Restart Odoo so the entrypoint runs `-u all` as the sole DB actor (swarm)"
|
|
ansible.builtin.include_tasks: 03_install_modules/swarm_drain_restart.yml
|
|
when: DEPLOYMENT_MODE == 'swarm'
|
|
|
|
- name: "🔍 Re-resolve Odoo hosting node + container id after the update restart"
|
|
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
|
|
vars:
|
|
resolve_service_key: "{{ ODOO_SERVICE }}"
|
|
resolve_output_prefix: ODOO
|
|
resolve_compose_cid: "{{ ODOO_CONTAINER }}"
|
|
|
|
- name: "⏳ Wait for Odoo to serve /web/health after the `-u all` update restart"
|
|
ansible.builtin.shell: |
|
|
set -eu
|
|
# nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node
|
|
container exec {{ ODOO_LOCAL_CID | quote }} timeout 10 bash -c 'exec 3<>/dev/tcp/localhost/{{ container_port }} && printf "GET /web/health HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n" >&3 && IFS= read -r _status <&3 && case "$_status" in *" 200 "*) exit 0 ;; *) exit 1 ;; esac'
|
|
delegate_to: "{{ ODOO_HOST_NODE }}"
|
|
register: odoo_health_after_update
|
|
changed_when: false
|
|
retries: 60
|
|
delay: 10
|
|
until: odoo_health_after_update.rc == 0
|