docker/application: Configure dns and log-driver of daemon

master
Felix Stupp 3 years ago
parent e9651f3b09
commit f825787dd6
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -126,6 +126,10 @@ global_dns_upstream_servers:
global_dnsmasq_configuration_file: "/etc/dnsmasq.conf"
global_dnsmasq_configuration_directory: "/etc/dnsmasq.d"
global_docker_service_name: "docker.service"
global_docker_configuration_directory: "/etc/docker"
global_docker_daemon_configuration_file: "{{ global_docker_configuration_directory }}/daemon.json"
global_fail2ban_service_name: "fail2ban.service"
global_fail2ban_system_directory: "/etc/fail2ban"
global_fail2ban_configuration_directory: "{{ global_fail2ban_system_directory }}/fail2ban.d"

@ -0,0 +1,5 @@
---
docker_configuration:
dns: "{{ ansible_dns.nameservers | ipv4 }}" # use only ipv4 dns servers TODO: check if docker supports ipv6
log-driver: journald # send container logs also to journald

@ -0,0 +1,6 @@
---
- name: restart docker
systemd:
name: "{{ global_docker_service_name }}"
state: restarted

@ -7,3 +7,12 @@
- docker.io
- docker-compose
- python3-docker
- name: Configure docker daemon
copy:
content: "{{ docker_configuration | to_nice_json }}\n"
dest: "{{ global_docker_daemon_configuration_file }}"
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart docker

Loading…
Cancel
Save