[P3] fresh_install.yml runs full dist-upgrade — risky if run against existing machines #8

Closed
opened 2026-03-22 18:04:11 +00:00 by jeet · 0 comments
Owner

Problem

The playbook runs a full distribution upgrade as part of fresh install. If accidentally run against a production host (e.g., a Prod server mistakenly in the target group), it can upgrade the OS while services are running.

Fix

Add a safety guard that aborts if Docker containers are already running:

- name: Abort if containers are already running
  ansible.builtin.shell: docker compose ps -q
  args:
    chdir: ~/docker
  register: running
  failed_when: running.stdout != ""
  ignore_errors: false

Or split the dist-upgrade step into its own dedicated playbook.

File: playbooks/fresh_install.yml

## Problem The playbook runs a full distribution upgrade as part of fresh install. If accidentally run against a production host (e.g., a Prod server mistakenly in the target group), it can upgrade the OS while services are running. ## Fix Add a safety guard that aborts if Docker containers are already running: ```yaml - name: Abort if containers are already running ansible.builtin.shell: docker compose ps -q args: chdir: ~/docker register: running failed_when: running.stdout != "" ignore_errors: false ``` Or split the dist-upgrade step into its own dedicated playbook. **File:** `playbooks/fresh_install.yml`
jeet closed this issue 2026-03-22 18:14:21 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jeet/OCI_Build#8