diff --git a/roles/kea/tasks/main.yml b/roles/kea/tasks/main.yml index 8760aa7..64ab80c 100644 --- a/roles/kea/tasks/main.yml +++ b/roles/kea/tasks/main.yml @@ -1,16 +1,16 @@ --- - name: Preparation - shell: curl -1sLf 'https://dl.cloudsmith.io/public/isc/kea-2-4/setup.deb.sh' | sudo -E bash + ansible.builtin.shell: curl -1sLf 'https://dl.cloudsmith.io/public/isc/kea-2-4/setup.deb.sh' | sudo -E bash - name: Update apt ansible.builtin.apt: update_cache: yes -- name: Installation paquet isc-kea-common - ansible.builtin.apt: - deb: isc-kea-common - state: present + #- name: Installation paquet isc-kea-common + # ansible.builtin.apt: + # deb: isc-kea-common + # state: present - name: Installation isc-kea-dhcp4 ansible.builtin.apt: @@ -27,8 +27,8 @@ name: isc-kea-hooks state: present -- name: Generation du fichier de configuration kea-ctrl-agent - ansible.builtin.copy: +- name: Generation ---- du fichier de configuration kea-ctrl-agent + ansible.builtin.template: src: kea-ctrl-agent.conf.j2 dest: /etc/kea/kea-ctrl-agent.conf notify: diff --git a/roles/kea/templates/kea-ctrl-agent.conf.j2 b/roles/kea/templates/kea-ctrl-agent.conf.j2 index 587a6af..413e940 100644 --- a/roles/kea/templates/kea-ctrl-agent.conf.j2 +++ b/roles/kea/templates/kea-ctrl-agent.conf.j2 @@ -1,66 +1,31 @@ -// This is an example of a configuration for Control-Agent (CA) listening -// for incoming HTTP traffic. This is necessary for handling API commands, -// in particular lease update commands needed for HA setup. -{ - "Control-agent": - { - // We need to specify where the agent should listen to incoming HTTP - // queries. - "http-host": "{{ kea_ctrl_address }}", - - // This specifies the port CA will listen on. - "http-port": 8000, - - "control-sockets": - { - // This is how the Agent can communicate with the DHCPv4 server. - "dhcp4": - { - "comment": "socket to DHCPv4 server", - "socket-type": "unix", - "socket-name": "/tmp/kea4-ctrl-socket" - }, - - // Location of the DHCPv6 command channel socket. - # "dhcp6": - # { - # "socket-type": "unix", - # "socket-name": "/tmp/kea6-ctrl-socket" - # }, - - // Location of the D2 command channel socket. - # "d2": - # { - # "socket-type": "unix", - # "socket-name": "/tmp/kea-ddns-ctrl-socket", - # "user-context": { "in-use": false } - # } - }, - - // Similar to other Kea components, CA also uses logging. - "loggers": [ - { - "name": "kea-ctrl-agent", - "output_options": [ - { - "output": "stdout", - - // Several additional parameters are possible in addition - // to the typical output. Flush determines whether logger - // flushes output to a file. Maxsize determines maximum - // filesize before the file is rotated. maxver - // specifies the maximum number of rotated files being - // kept. - "flush": true, - "maxsize": 204800, - "maxver": 4, - // We use pattern to specify custom log message layout - "pattern": "%d{%y.%m.%d %H:%M:%S.%q} %-5p [%c/%i] %m\n" - } - ], - "severity": "INFO", - "debuglevel": 0 // debug level only applies when severity is set to DEBUG. - } - ] - } -} +{ + "Control-agent": + { + "http-host": "{{ kea_ctrl_address_this }}", + "http-port": 8000, + "control-sockets": + { + "dhcp4": + { + "socket-type": "unix", + "socket-name": "/tmp/kea4-ctrl-socket" + }, + }, + + "loggers": [ + { + "name": "kea-ctrl-agent", + "output_options": [ + { + "output": "stdout", + "flush": true, + "maxsize": 204800, + "maxver": 4, + + } + ], + "severity": "INFO", + } + ] + } +} diff --git a/roles/kea/templates/kea-dhcp4.conf.j2 b/roles/kea/templates/kea-dhcp4.conf.j2 index 750977a..c92b84d 100644 --- a/roles/kea/templates/kea-dhcp4.conf.j2 +++ b/roles/kea/templates/kea-dhcp4.conf.j2 @@ -22,7 +22,7 @@ // The DHCPv4 server listens on this interface. When changing this to // the actual name of your interface, make sure to also update the // interface parameter in the subnet definition below. - "interfaces": {{ kea_dhcp_interfaces }} + "interfaces": "{{ kea_dhcp_int }}" }, // Control socket is required for communication between the Control @@ -76,12 +76,12 @@ // deliver lease updates to the server as well as synchronize the // lease database after failure. { - "library": "/usr/local/lib/kea/hooks/libdhcp_lease_cmds.so" + "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" }, { // The HA hook library should be loaded. - "library": "/usr/local/lib/kea/hooks/libdhcp_ha.so", + "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so", "parameters": { // Each server should have the same HA configuration, except for the // "this-server-name" parameter. diff --git a/s-kea1-ps.yml b/s-kea1-ps.yml index 3255d49..86b1391 100644 --- a/s-kea1-ps.yml +++ b/s-kea1-ps.yml @@ -11,11 +11,11 @@ kea_dhcp_int: ["enp0s9"] roles: - - base - - goss + - base + - goss # - ssh-cli - kea # - zabbix-cli # - journald-snd # - snmp-agent - - post + - post