From 065fe9042d88278adc8659382d6db183030b07cc Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 8 Oct 2020 17:01:12 -0400 Subject: [PATCH] [fix] Make sure Playbook is up before creating user --- salt/playbook/automation_user_create.sls | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/salt/playbook/automation_user_create.sls b/salt/playbook/automation_user_create.sls index 3e9c56594..04b8687cb 100644 --- a/salt/playbook/automation_user_create.sls +++ b/salt/playbook/automation_user_create.sls @@ -1,9 +1,18 @@ +{% set MAINIP = salt['pillar.get']('global:managerip') %} + # This state will create the SecOps Automation user within Playbook include: - playbook + +cmd.run: + - name: until nc -z {{ MAINIP }} 3200; do sleep 1; done + - timeout: 30 + - onchanges: + - cmd: create_user -salt://playbook/files/automation_user_create.sh: +create_user: cmd.script: + - source: salt://playbook/files/automation_user_create.sh - cwd: /root - template: jinja