diff --git a/.ansible.d/setup.sh b/.ansible.d/setup.sh index f59198f..2db1b8a 100755 --- a/.ansible.d/setup.sh +++ b/.ansible.d/setup.sh @@ -3,7 +3,7 @@ IP=$1 KEY_FILE="~/.ssh/setuproot.key.priv" PLAYBOOK="./.ansible.d/setup.yml" -until /dev/tcp/$IP/22; do +until nc -z -w $timeout $host $port; do echo "Attempting connection to $IP. For first setup script." ansible-playbook --key-file "$KEY_FILE" -i "$IP," "$PLAYBOOK" echo "Connection attempt failed. Retrying in 1 second." diff --git a/roles/ind/zabbix/zabbix-install.yml b/roles/ind/zabbix/zabbix-install.yml index 46ecaba..6e9570d 100644 --- a/roles/ind/zabbix/zabbix-install.yml +++ b/roles/ind/zabbix/zabbix-install.yml @@ -139,7 +139,15 @@ owner: docker group: docker mode: u=rw,g=r,o=r - + + - name: Write docker-compose.env + ansible.builtin.copy: + src: docker-compose.env + dest: /home/promgraf/docker-compose.env + owner: promgraf + group: docker + mode: u=rw,g=r,o=r + - name: Check if zabbix directory exists stat: path: /zabbix