From 83ab156a45bd52797b1b6f6ca8647c7a3e219463 Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 8 Jan 2025 11:22:42 +0200 Subject: [PATCH] lockfile_behavior_bugfix --- roles/_init/tasks/main.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/roles/_init/tasks/main.yml b/roles/_init/tasks/main.yml index 445655c5..34340018 100644 --- a/roles/_init/tasks/main.yml +++ b/roles/_init/tasks/main.yml @@ -8,21 +8,15 @@ path: "{{ provision_lock_file }}" register: _ce_provision_lock -- name: Abort if ce-provision lock file exists. +- name: Fail the pipeline if ce-provision lock file exists. + ansible.builtin.fail: + msg: "ce-provision lock file discovered, an infrastructure build is in progress! If this is not the case, login to the affected server and delete the file at {{ provision_lock_file }}." when: _ce_provision_lock.stat.exists is defined and _ce_provision_lock.stat.exists - block: - - name: Abort if ce-provision lock file is found. - ansible.builtin.debug: - msg: "ce-provision lock file discovered, an infrastructure build is in progress! If this is not the case, login to the affected server and delete the file at {{ provision_lock_file }}." - - ansible.builtin.meta: end_play -- name: Check OS family. +- name: Fail the pipeline if target is a Windows server. + ansible.builtin.fail: + msg: "ce-deploy currently only supports Linux like operating systems, and works best with Debian Linux." when: ansible_os_family == "Windows" - block: - - name: Abort if target is a Windows server. - ansible.builtin.debug: - msg: "ce-deploy currently only supports Linux like operating systems, and works best with Debian Linux." - - ansible.builtin.meta: end_play - name: Set a lock file. ansible.builtin.file: