diff --git a/roles/kea/handlers/main.yml b/roles/kea/handlers/main.yml index b3765c6..fbd6145 100644 --- a/roles/kea/handlers/main.yml +++ b/roles/kea/handlers/main.yml @@ -2,3 +2,6 @@ - name: Restart kea-dhcp4-server service: name=kea-dhcp4-server state=restarted + +- name: Restart kea-ctrl-agent + service: name=kea-ctrl-agent state=restarted diff --git a/roles/kea/tasks/main.yml b/roles/kea/tasks/main.yml index 8b3df6a..5ce8a17 100644 --- a/roles/kea/tasks/main.yml +++ b/roles/kea/tasks/main.yml @@ -3,10 +3,11 @@ - name: Install the kea dhcp server apt: name: + - kea-ctrl-agent - kea-dhcp4-server - kea-dhcp-ddns-server -- name: Configure the kea dhcp server +- name: Configure the kea dhcp4 server template: src: kea/kea-dhcp4.conf.j2 dest: /etc/kea/kea-dhcp4.conf @@ -15,3 +16,13 @@ - name: Start the kea dhcp server service: name=kea-dhcp4-server state=started enabled=yes + +- name: Configure the kea control agent + template: + src: kea/kea-ctrl-agent.conf.j2 + dest: /etc/kea/kea-ctrl-agent.conf +# validate: kea-ctrl-agent -t %s + notify: Restart kea-ctrl-agent + +- name: Start the kea control agent + service: name=kea-ctrl-agent state=started enabled=yes diff --git a/roles/kea/templates/kea/kea-ctrl-agent.conf.j2 b/roles/kea/templates/kea/kea-ctrl-agent.conf.j2 new file mode 100644 index 0000000..08435df --- /dev/null +++ b/roles/kea/templates/kea/kea-ctrl-agent.conf.j2 @@ -0,0 +1,37 @@ +{ + "Control-agent": + { + "http-host": "0.0.0.0", + "http-port": 8000, + "control-sockets": + { + "dhcp4": + { + "comment": "socket to DHCP4 server", + "socket-type": "unix", + "socket-name": "/tmp/kea4-ctrl-socket" + }, + + "d2": + { + "socket-type": "unix", + "socket-name": "/tmp/kea-ddns-ctrl-socket", + "user-context": { "in-use": false } + } + }, + + "loggers": [ + { + "name": "kea-ctrl-agent", + "output_options": [ + { + "output": "stdout", + "pattern": "%-5p %m\n" + } + ], + "severity": "INFO", + "debuglevel": 0 + } + ] + } +}