mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Finalize systemd compatibility
Add Jinja2 template for systemd drop-in file to customize Docker daemon behavior. Edit Ansible playbook to support use of systemd drop-in files. Signed-off-by: Scott S. Lowe <scott.lowe@scottlowe.org>
This commit is contained in:
parent
72a72560fb
commit
96a07a48e3
2 changed files with 22 additions and 4 deletions
5
ovn-docker-ansible/10-exec-options.conf.j2
Normal file
5
ovn-docker-ansible/10-exec-options.conf.j2
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/docker daemon -H fd:// -H tcp://0.0.0.0:2375 \
|
||||
--cluster-store=consul://127.0.0.1:8500 \
|
||||
--cluster-advertise={{ ansible_enp0s8.ipv4.address }}:0
|
||||
|
|
@ -133,11 +133,21 @@
|
|||
- docker
|
||||
- packages
|
||||
|
||||
- name: Create systemd drop-in directory
|
||||
file:
|
||||
path: "/etc/systemd/system/docker.service.d"
|
||||
state: "directory"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0755"
|
||||
tags:
|
||||
- docker
|
||||
- docker-cfg
|
||||
|
||||
- name: Customize Docker daemon configuration
|
||||
lineinfile:
|
||||
dest: "/etc/default/docker"
|
||||
insertafter: '#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"'
|
||||
line: "DOCKER_OPTS='-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-store=consul://127.0.0.1:8500 --cluster-advertise={{ ansible_enp0s8.ipv4.address }}:0'"
|
||||
template:
|
||||
src: "10-exec-options.conf.j2"
|
||||
dest: "/etc/systemd/system/docker.service.d/10-exec-options.conf"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
|
|
@ -145,6 +155,9 @@
|
|||
- docker
|
||||
- docker-cfg
|
||||
|
||||
- name: Reload systemd units
|
||||
command: "systemctl daemon-reload"
|
||||
|
||||
- name: Restart Docker daemon
|
||||
service:
|
||||
name: "docker"
|
||||
|
|
|
|||
Loading…
Reference in a new issue