From ccc194e1a217ac0af2ec6f2ecd43ca025ebfd5eb Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 14 Mar 2024 17:12:44 -0700 Subject: [PATCH] ENH: require config mode in order to run the provisioning playbook --- tcbsd-provision-playbook.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tcbsd-provision-playbook.yaml b/tcbsd-provision-playbook.yaml index 4f2c861..a58ef38 100644 --- a/tcbsd-provision-playbook.yaml +++ b/tcbsd-provision-playbook.yaml @@ -5,6 +5,18 @@ - name: Verify connectivity with ping ansible.builtin.ping: + - name: Run PLC mode command + register: plc_mode + changed_when: false + ansible.builtin.command: + cmd: TcSysExe.exe --mode + + - name: Assert that PLC is in CONFIG mode + ansible.builtin.assert: + that: "{{ 'CONFIG' in plc_mode.stdout }}" + fail_msg: "PLC is in RUN mode! Abort!" + quiet: true + - name: Enable FreeBSD packages when: enable_freebsd_packages ansible.builtin.file: