From a970bbc851eac5586e57a7e97ef842e988441203 Mon Sep 17 00:00:00 2001 From: lightlike Date: Fri, 21 Jun 2024 13:38:20 +0200 Subject: [PATCH] logging update and use ansible dense output --- Dockerfile | 7 ++++++- ansible/update-dns.yaml | 3 ++- entrypoint.sh | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d657047..e40b635 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,13 @@ RUN apk add --no-cache \ RUN pip install --no-cache --break-system-packages nc-dnsapi -ENV ANSIBLE_STDOUT_CALLBACK=unixy +# Ansible specific variables +ENV ANSIBLE_STDOUT_CALLBACK=dense ENV ANSIBLE_LOAD_CALLBACK_PLUGINS=1 +ENV ANSIBLE_LOCALHOST_WARNING=False +ENV ANSIBLE_INVENTORY_UNPARSED_WARNING=False + +# DynDNS Variables ENV RECORDS="* @" ENV SCHEDULE="*/10 * * * *" diff --git a/ansible/update-dns.yaml b/ansible/update-dns.yaml index e62c0f7..28c577e 100644 --- a/ansible/update-dns.yaml +++ b/ansible/update-dns.yaml @@ -1,6 +1,7 @@ --- -- hosts: 127.0.0.1 +- hosts: localhost connection: local + gather_facts: no vars: data_base_path: "/tmp/netcup-dns" ipv4_path: "{{ data_base_path }}/IPv4" diff --git a/entrypoint.sh b/entrypoint.sh index 893e505..87f7668 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,7 @@ #!/bin/sh + +echo "Creating cronjob with schedule: ${SCHEDULE}" echo "${SCHEDULE} ansible-playbook /netcup-dns/ansible/update-dns.yaml" > /etc/crontabs/root + +echo "Running command: '$@'" exec "$@"