From 31462f85eef07e9083c758f11fc19695ada0a8db Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 28 Jan 2020 22:17:12 +0000 Subject: [PATCH] Validate compose files --- ansible/roles/docker/tasks/dnsmasq.yml | 1 + ansible/roles/docker/tasks/netdata.yml | 1 + ansible/roles/docker/tasks/portainer.yml | 1 + ansible/roles/docker/tasks/watchtower.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/ansible/roles/docker/tasks/dnsmasq.yml b/ansible/roles/docker/tasks/dnsmasq.yml index d764cf4..a1d318e 100644 --- a/ansible/roles/docker/tasks/dnsmasq.yml +++ b/ansible/roles/docker/tasks/dnsmasq.yml @@ -16,6 +16,7 @@ dest: "/opt/dnsmasq/docker-compose.yml" mode: "{{ docker_compose_file_mask }}" owner: "{{ docker_user.name }}" + validate: /usr/bin/docker-compose -f %s config register: compose_file become: true become_user: root diff --git a/ansible/roles/docker/tasks/netdata.yml b/ansible/roles/docker/tasks/netdata.yml index 8bcd2a9..efc2240 100644 --- a/ansible/roles/docker/tasks/netdata.yml +++ b/ansible/roles/docker/tasks/netdata.yml @@ -13,6 +13,7 @@ dest: "/opt/netdata/docker-compose.yml" mode: "{{ docker_compose_file_mask }}" owner: "{{ docker_user.name }}" + validate: /usr/bin/docker-compose -f %s config register: compose_file become: true become_user: root diff --git a/ansible/roles/docker/tasks/portainer.yml b/ansible/roles/docker/tasks/portainer.yml index 4387467..7e84b99 100644 --- a/ansible/roles/docker/tasks/portainer.yml +++ b/ansible/roles/docker/tasks/portainer.yml @@ -13,6 +13,7 @@ dest: "/opt/portainer/docker-compose.yml" mode: "{{ docker_compose_file_mask }}" owner: "{{ docker_user.name }}" + validate: /usr/bin/docker-compose -f %s config register: compose_file become: true become_user: root diff --git a/ansible/roles/docker/tasks/watchtower.yml b/ansible/roles/docker/tasks/watchtower.yml index 784a510..9a79747 100644 --- a/ansible/roles/docker/tasks/watchtower.yml +++ b/ansible/roles/docker/tasks/watchtower.yml @@ -13,6 +13,7 @@ dest: "/opt/watchtower/docker-compose.yml" mode: "{{ docker_compose_file_mask }}" owner: "{{ docker_user.name }}" + validate: /usr/bin/docker-compose -f %s config register: compose_file become: true become_user: root