diff --git a/goss/s-kea1.yaml b/goss/s-kea1.yaml index 9a0a59f..768862e 100644 --- a/goss/s-kea1.yaml +++ b/goss/s-kea1.yaml @@ -1,90 +1,93 @@ file: - /etc/kea/kea-ctrl-agent.conf: - exists: true - mode: "0644" - size: 2470 - owner: _kea - group: root - filetype: file - contains: [] - /etc/kea/kea-dhcp4.conf: - exists: true - mode: "0644" - size: 11346 - owner: _kea - group: root - filetype: file - contains: [] - /tmp/kea4-ctrl-socket: - exists: true - mode: "0755" - size: 0 - owner: _kea - group: _kea - filetype: socket - contains: [] - /usr/local/lib/kea: - exists: true - mode: "0755" - size: 4096 - owner: root - group: root - filetype: directory - contains: [] + /etc/kea/kea-ctrl-agent.conf: + exists: true + mode: "0644" + owner: _kea + group: root + filetype: file + contents: [] + /etc/kea/kea-dhcp4.conf: + exists: true + mode: "0644" + owner: _kea + group: root + filetype: file + contents: [] + /tmp/kea4-ctrl-socket: + exists: true + mode: "0755" + size: 0 + owner: _kea + group: _kea + filetype: socket + contains: [] + contents: null + /usr/lib/x86_64-linux-gnu/kea: + exists: true + mode: "0755" + owner: root + group: root + filetype: directory + contents: [] package: - isc-kea-common: - installed: true - versions: - - 2.4.1-isc20231123184533 - isc-kea-ctrl-agent: - installed: true - versions: - - 2.4.1-isc20231123184533 - isc-kea-dhcp4: - installed: true - versions: - - 2.4.1-isc20231123184533 - isc-kea-hooks: - installed: true - versions: - - 2.4.1-isc20231123184533 - libmariadb3: - installed: true - versions: - - 1:10.11.4-1~deb12u1 - mariadb-common: - installed: true - versions: - - 1:10.11.4-1~deb12u1 - mysql-common: - installed: true - versions: - - 5.8+1.1.0 + isc-kea-common: + installed: true + versions: + - 2.4.1-isc20231123184533 + isc-kea-ctrl-agent: + installed: true + versions: + - 2.4.1-isc20231123184533 + isc-kea-dhcp4: + installed: true + versions: + - 2.4.1-isc20231123184533 + isc-kea-hooks: + installed: true + versions: + - 2.4.1-isc20231123184533 + libmariadb3: + installed: true + versions: + - 1:10.11.4-1~deb12u1 + mariadb-common: + installed: true + versions: + - 1:10.11.4-1~deb12u1 + mysql-common: + installed: true + versions: + - 5.8+1.1.0 +addr: + udp://172.16.64.254:67: + local-address: 127.0.0.1 + reachable: true + timeout: 500 port: - tcp:8000: - listening: true - ip: - - 172.16.64.20 + tcp:8000: + listening: true + ip: + - 172.16.0.20 service: - isc-kea-ctrl-agent.service: - enabled: true - running: true - isc-kea-dhcp4-server.service: - enabled: true - running: true + isc-kea-ctrl-agent.service: + enabled: true + running: true + isc-kea-dhcp4-server.service: + enabled: true + running: true interface: - enp0s3: - exists: true - addrs: - - 192.168.99.20/24 - mtu: 1500 - enp0s8: - exists: true - addrs: - - 172.16.0.20/24 - mtu: 1500 - enp0s9: - exists: true - addrs: - - 172.16.64.20/24 - mtu: 1500 + enp0s3: + exists: true + addrs: + - 192.168.99.20/24 + mtu: 1500 + enp0s8: + exists: true + addrs: + - 172.16.0.20/24 + mtu: 1500 + enp0s9: + exists: true + addrs: + - 172.16.64.20/24 + mtu: 1500 diff --git a/goss/s-kea2.yaml b/goss/s-kea2.yaml index 9fe75be..b0766b3 100644 --- a/goss/s-kea2.yaml +++ b/goss/s-kea2.yaml @@ -1,90 +1,93 @@ file: - /etc/kea/kea-ctrl-agent.conf: - exists: true - mode: "0644" - size: 2470 - owner: _kea - group: root - filetype: file - contains: [] - /etc/kea/kea-dhcp4.conf: - exists: true - mode: "0644" - size: 11346 - owner: _kea - group: root - filetype: file - contains: [] - /tmp/kea4-ctrl-socket: - exists: true - mode: "0755" - size: 0 - owner: _kea - group: _kea - filetype: socket - contains: [] - /usr/local/lib/kea: - exists: true - mode: "0755" - size: 4096 - owner: root - group: root - filetype: directory - contains: [] + /etc/kea/kea-ctrl-agent.conf: + exists: true + mode: "0644" + owner: _kea + group: root + filetype: file + contents: [] + /etc/kea/kea-dhcp4.conf: + exists: true + mode: "0644" + owner: _kea + group: root + filetype: file + contents: [] + /tmp/kea4-ctrl-socket: + exists: true + mode: "0755" + size: 0 + owner: _kea + group: _kea + filetype: socket + contains: [] + contents: null + /usr/lib/x86_64-linux-gnu/kea: + exists: true + mode: "0755" + owner: root + group: root + filetype: directory + contents: [] package: - isc-kea-common: - installed: true - versions: - - 2.4.1-isc20231123184533 - isc-kea-ctrl-agent: - installed: true - versions: - - 2.4.1-isc20231123184533 - isc-kea-dhcp4: - installed: true - versions: - - 2.4.1-isc20231123184533 - isc-kea-hooks: - installed: true - versions: - - 2.4.1-isc20231123184533 - libmariadb3: - installed: true - versions: - - 1:10.11.4-1~deb12u1 - mariadb-common: - installed: true - versions: - - 1:10.11.4-1~deb12u1 - mysql-common: - installed: true - versions: - - 5.8+1.1.0 + isc-kea-common: + installed: true + versions: + - 2.4.1-isc20231123184533 + isc-kea-ctrl-agent: + installed: true + versions: + - 2.4.1-isc20231123184533 + isc-kea-dhcp4: + installed: true + versions: + - 2.4.1-isc20231123184533 + isc-kea-hooks: + installed: true + versions: + - 2.4.1-isc20231123184533 + libmariadb3: + installed: true + versions: + - 1:10.11.4-1~deb12u1 + mariadb-common: + installed: true + versions: + - 1:10.11.4-1~deb12u1 + mysql-common: + installed: true + versions: + - 5.8+1.1.0 +addr: + udp://172.16.64.254:67: + local-address: 127.0.0.1 + reachable: true + timeout: 500 port: - tcp:8000: - listening: true - ip: - - 172.16.64.21 + tcp:8000: + listening: true + ip: + - 172.16.0.21 service: - isc-kea-ctrl-agent.service: - enabled: true - running: true - isc-kea-dhcp4-server.service: - enabled: true - running: true + isc-kea-ctrl-agent.service: + enabled: true + running: true + isc-kea-dhcp4-server.service: + enabled: true + running: true interface: - enp0s3: - exists: true - addrs: - - 192.168.99.21/24 - mtu: 1500 - enp0s8: - exists: true - addrs: - - 172.16.0.21/24 - mtu: 1500 - enp0s9: - exists: true - addrs: - - 172.16.64.21/24 - mtu: 1500 + enp0s3: + exists: true + addrs: + - 192.168.99.21/24 + mtu: 1500 + enp0s8: + exists: true + addrs: + - 172.16.0.21/24 + mtu: 1500 + enp0s9: + exists: true + addrs: + - 172.16.64.21/24 + mtu: 1500 diff --git a/roles/kea/README.md b/roles/kea/README.md index 56f614d..51cd0d9 100644 --- a/roles/kea/README.md +++ b/roles/kea/README.md @@ -1,14 +1,21 @@ # Rôle Kea *** -Rôle du Kea pour la haute disponibilité dhcp +Rôle Kea: Configuration de 2 serveurs KEA en mode haute disponbilité. ## Tables des matières 1. [Que fait le rôle Kea ?] + 2. [Installation et configuration de ka] + 3. [Remarques] ## Que fait le rôle Kea ? -Il permet de configurer les serveur kea en mode haute disponibilité. +Le rôle KEA permet de configurer 1 serveurs kea (s-kea1 et s-kea2) en mode haute disponibilité. +- Le serveur **s-kea1** sera en mode **primary** il délivrera les baux DHCP sur le réseau n-user. +- Le serveur **s-kea2**, sera en mode **stand-by** le service DHCP basculera donc sur **s-kea2** en cas disponibilité du serveur**s-kea1**. ### Installation et configuration de kea -Le rôle kea va installer les packets kea dhcp4, hook, admin une fois les packets installer. Nous allons configurer les 2 serveurs kea pour qu'il distribut les ip de n-user et soit en haute disponibilité. +Le rôle kea installe les packets **kea dhcp4, hooks, admin** une fois les packets installer. Il configure un serveur kea pour qu'il distribue les ips sur le réseau n-user et soit en haute disponibilité. + +### Remarquees ### +Une fois le playbook **s-kea** correctement terminé et la machine **s-kea** redemarrée, redémarrée le service **isc-kea-dhcp4.service** afin de prendre en compte les modifications éfféctuées sur la couche réseau par le role POST. diff --git a/roles/kea/templates/kea-ctrl-agent.conf.j2 b/roles/kea/templates/kea-ctrl-agent.conf.j2 index 18c29d9..27879f5 100644 --- a/roles/kea/templates/kea-ctrl-agent.conf.j2 +++ b/roles/kea/templates/kea-ctrl-agent.conf.j2 @@ -25,6 +25,7 @@ } ], "severity": "INFO", + "debuglevel": 0 } ] } diff --git a/roles/kea/templates/kea-dhcp4.conf.j2 b/roles/kea/templates/kea-dhcp4.conf.j2 index c92b84d..e210f37 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_int }}" + "interfaces": ["{{ kea_dhcp_int }}"] }, // Control socket is required for communication between the Control diff --git a/roles/kea-master/README.md b/roles/old/kea-master/README.md similarity index 100% rename from roles/kea-master/README.md rename to roles/old/kea-master/README.md diff --git a/roles/kea-master/default/main.yml b/roles/old/kea-master/default/main.yml similarity index 100% rename from roles/kea-master/default/main.yml rename to roles/old/kea-master/default/main.yml diff --git a/roles/kea-master/files/kea-ctrl-agent.conf b/roles/old/kea-master/files/kea-ctrl-agent.conf similarity index 100% rename from roles/kea-master/files/kea-ctrl-agent.conf rename to roles/old/kea-master/files/kea-ctrl-agent.conf diff --git a/roles/kea-master/files/kea-dhcp4.conf b/roles/old/kea-master/files/kea-dhcp4.conf similarity index 100% rename from roles/kea-master/files/kea-dhcp4.conf rename to roles/old/kea-master/files/kea-dhcp4.conf diff --git a/roles/kea-master/handlers/main.yml b/roles/old/kea-master/handlers/main.yml similarity index 100% rename from roles/kea-master/handlers/main.yml rename to roles/old/kea-master/handlers/main.yml diff --git a/roles/kea-master/tasks/main.yml b/roles/old/kea-master/tasks/main.yml similarity index 100% rename from roles/kea-master/tasks/main.yml rename to roles/old/kea-master/tasks/main.yml diff --git a/roles/kea-slave/README.md b/roles/old/kea-slave/README.md similarity index 100% rename from roles/kea-slave/README.md rename to roles/old/kea-slave/README.md diff --git a/roles/kea-slave/default/main.yml b/roles/old/kea-slave/default/main.yml similarity index 100% rename from roles/kea-slave/default/main.yml rename to roles/old/kea-slave/default/main.yml diff --git a/roles/kea-slave/files/kea-ctrl-agent.conf b/roles/old/kea-slave/files/kea-ctrl-agent.conf similarity index 100% rename from roles/kea-slave/files/kea-ctrl-agent.conf rename to roles/old/kea-slave/files/kea-ctrl-agent.conf diff --git a/roles/kea-slave/files/kea-dhcp4.conf b/roles/old/kea-slave/files/kea-dhcp4.conf similarity index 100% rename from roles/kea-slave/files/kea-dhcp4.conf rename to roles/old/kea-slave/files/kea-dhcp4.conf diff --git a/roles/kea-slave/handlers/main.yml b/roles/old/kea-slave/handlers/main.yml similarity index 100% rename from roles/kea-slave/handlers/main.yml rename to roles/old/kea-slave/handlers/main.yml diff --git a/roles/kea-slave/tasks/main.yml b/roles/old/kea-slave/tasks/main.yml similarity index 100% rename from roles/kea-slave/tasks/main.yml rename to roles/old/kea-slave/tasks/main.yml diff --git a/s-kea1-ps.yml b/s-kea1-ps.yml deleted file mode 100644 index 86b1391..0000000 --- a/s-kea1-ps.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- hosts: localhost - connection: local - vars: - kea_this_server: "s-kea1" - kea_srv1: "s-kea1" - kea_srv2: "s-kea2" - kea_ctrl_address_this: "172.16.0.20" - kea_ctrl_address1: "172.16.0.20" - kea_ctrl_address2: "172.16.0.21" - kea_dhcp_int: ["enp0s9"] - - roles: - - base - - goss - # - ssh-cli - - kea - # - zabbix-cli - # - journald-snd - # - snmp-agent - - post diff --git a/s-kea1.yml b/s-kea1.yml index 96990c9..0685bb1 100644 --- a/s-kea1.yml +++ b/s-kea1.yml @@ -1,13 +1,21 @@ --- - hosts: localhost connection: local + vars: + kea_this_server: "s-kea1" + kea_srv1: "s-kea1" + kea_srv2: "s-kea2" + kea_ctrl_address_this: "172.16.0.20" + kea_ctrl_address1: "172.16.0.20" + kea_ctrl_address2: "172.16.0.21" + kea_dhcp_int: "enp0s9" roles: - base - #- goss - #- ssh-cli - - kea-master - #- zabbix-cli - #- journald-snd - #- snmp-agent + - goss + - ssh-cli + - kea + # - zabbix-cli + - journald-snd + - snmp-agent - post diff --git a/s-kea2.yml b/s-kea2.yml index a493f3f..bd5554f 100644 --- a/s-kea2.yml +++ b/s-kea2.yml @@ -1,13 +1,21 @@ --- - hosts: localhost connection: local + vars: + kea_this_server: "s-kea2" + kea_srv1: "s-kea1" + kea_srv2: "s-kea2" + kea_ctrl_address_this: "172.16.0.21" + kea_ctrl_address1: "172.16.0.20" + kea_ctrl_address2: "172.16.0.21" + kea_dhcp_int: "enp0s9" roles: - base - # - goss - # - ssh-cli - - kea-slave - # - zabbix-cli - # - journald-snd - # - snmp-agent + - goss + - ssh-cli + - kea + # - zabbix-cli + - journald-snd + - snmp-agent - post