WIP: new z9 ccchh router #98
kea_dhcp(role): some fixes and removing arch part
- remove tags from tasks - remove archlinux part - use debian default package for kea
|
|
@ -1,7 +1,6 @@
|
||||||
kea_dhcp__stork_agent:
|
kea_dhcp__stork_agent:
|
||||||
enable: false
|
enable: false
|
||||||
prometheus_only: true
|
prometheus_only: true
|
||||||
kea_dhcp__version_repo: "kea-3-0"
|
|
||||||
kea_dhcp__dns_servers:
|
kea_dhcp__dns_servers:
|
||||||
v6:
|
v6:
|
||||||
- "2a07:c481:0:4::2"
|
- "2a07:c481:0:4::2"
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,19 @@
|
||||||
ansible.builtin.systemd_service:
|
ansible.builtin.systemd_service:
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
|
||||||
- name: Kea_dhcp4.reloaded
|
- name: Kea_dhcp4.restarted
|
||||||
|
bitwhisker marked this conversation as resolved
Outdated
|
|||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: kea-dhcp4
|
name: kea-dhcp4
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Kea_dhcp6.reloaded
|
- name: Kea_dhcp6.restarted
|
||||||
|
bitwhisker marked this conversation as resolved
Outdated
june
commented
Same restarted/reloaded comment as above. Same restarted/reloaded comment as above.
|
|||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: kea-dhcp6
|
name: kea-dhcp6
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Kea_ctrl.reloaded
|
- name: Kea_ctrl.restarted
|
||||||
|
bitwhisker marked this conversation as resolved
Outdated
june
commented
Same restarted/reloaded comment as above. Same restarted/reloaded comment as above.
|
|||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: kea-ctrl-agent
|
name: kea-ctrl-agent
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ argument_specs:
|
||||||
interfaces:
|
interfaces:
|
||||||
type: "list"
|
type: "list"
|
||||||
elements: "str"
|
elements: "str"
|
||||||
default: []
|
default: [ ]
|
||||||
control-sockets:
|
control-sockets:
|
||||||
type: "list"
|
type: "list"
|
||||||
elements: "dict"
|
elements: "dict"
|
||||||
|
|
@ -85,7 +85,7 @@ argument_specs:
|
||||||
interfaces:
|
interfaces:
|
||||||
type: "list"
|
type: "list"
|
||||||
elements: "str"
|
elements: "str"
|
||||||
default: []
|
default: [ ]
|
||||||
control-sockets:
|
control-sockets:
|
||||||
type: "list"
|
type: "list"
|
||||||
elements: "dict"
|
elements: "dict"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
- name: Install Kea on Archlinux
|
|
||||||
when: ansible_facts['distribution'] == "Archlinux"
|
|
||||||
become: true
|
|
||||||
community.general.pacman:
|
|
||||||
name: kea
|
|
||||||
state: present
|
|
||||||
update_cache: false
|
|
||||||
|
|
@ -1,22 +1,25 @@
|
||||||
---
|
---
|
||||||
- name: Register isc-kea apt repository
|
|
||||||
become: true
|
|
||||||
register: kea_dhcp_repo
|
|
||||||
when: ansible_facts['distribution'] == "Debian"
|
|
||||||
ansible.builtin.deb822_repository:
|
|
||||||
name: "isc-{{ kea_dhcp__version_repo }}"
|
|
||||||
uris: "https://dl.cloudsmith.io/public/isc/{{ kea_dhcp__version_repo }}/deb/debian"
|
|
||||||
suites: any-version
|
|
||||||
components: main
|
|
||||||
signed_by: "https://dl.cloudsmith.io/public/isc/{{ kea_dhcp__version_repo }}/gpg.key"
|
|
||||||
|
|
||||||
- name: Install Kea packages
|
- name: Install Kea packages
|
||||||
become: true
|
become: true
|
||||||
when: ansible_facts['distribution'] == "Debian"
|
when: ansible_facts['distribution'] == "Debian"
|
||||||
ansible.builtin.apt:
|
block:
|
||||||
name:
|
- name: Install Kea dhcp4
|
||||||
- isc-kea-dhcp4
|
when: kea_dhcp__dhcp4.enable
|
||||||
- isc-kea-dhcp6
|
ansible.builtin.apt:
|
||||||
|
bitwhisker marked this conversation as resolved
Outdated
june
commented
Do we have a requirement for the more up-to-date version present in the upstream repository or is the one in the Debian repos sufficient? Do we have a requirement for the more up-to-date version present in the upstream repository or is the one in the Debian repos sufficient?
bitwhisker
commented
chris wrote this, I don't know why they thought this would be necessary chris wrote this, I don't know why they thought this would be necessary
@c6ristian
c6ristian
commented
For Club this properly doesn't matter. This was because the compatibility between different version has history been often Subject to Change. As long as there are no plan to do HA its probably fine. For Club this properly doesn't matter. This was because the compatibility between different version has history been often Subject to Change. As long as there are no plan to do HA its probably fine.
june
commented
Alright, gotcha. Then just using the Debian-packaged version nicely saves us adding a repo. Alright, gotcha. Then just using the Debian-packaged version nicely saves us adding a repo.
|
|||||||
- isc-kea-ctrl-agent
|
name:
|
||||||
- isc-kea-admin
|
- isc-kea-dhcp4
|
||||||
update_cache: "{{ kea_dhcp_install_repo.changed }}"
|
- name: Install Kea dhcp6
|
||||||
|
when: kea_dhcp__dhcp6.enable
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
|
- isc-kea-dhcp6
|
||||||
|
- name: Install Kea ctrl agent
|
||||||
|
when: kea_dhcp__stork_agent.enable
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
|
bitwhisker marked this conversation as resolved
Outdated
june
commented
Since we got granular control over whether to use dhcpv4, v6 or the agent, would it make sense to then also granularly install the relevant packages? Since we got granular control over whether to use dhcpv4, v6 or the agent, would it make sense to then also granularly install the relevant packages?
I would think Debian would also automatically start the services, which wouldn't make sense, if no sensible v6 config is present.
|
|||||||
|
- isc-kea-ctrl-agent
|
||||||
|
- name: Install Kea admin
|
||||||
|
when: kea_dhcp__stork_agent.enable
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name:
|
||||||
|
- isc-kea-admin
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: Include config vars
|
- name: Include config vars
|
||||||
tags: [ kea, include_vars ]
|
|
||||||
when: kea_dhcp__include_vars is not None
|
when: kea_dhcp__include_vars is not None
|
||||||
|
bitwhisker marked this conversation as resolved
Outdated
june
commented
I would rather just stick to only having tags at the playbook level. I don't think this kind granular control for the role is really needed as it the config files also shouldn't trigger a reload, if not changed. I would rather just stick to only having tags at the playbook level. I don't think this kind granular control for the role is really needed as it the config files also shouldn't trigger a reload, if not changed.
bitwhisker
commented
this was just copied from the fux noc ansible, but I can remove it this was just copied from the fux noc ansible, but I can remove it
|
|||||||
ansible.builtin.include_vars:
|
ansible.builtin.include_vars:
|
||||||
file: "{{ kea_dhcp__include_vars }}"
|
file: "{{ kea_dhcp__include_vars }}"
|
||||||
|
|
||||||
- name: Deploy kea-dhcp4 configuration file
|
- name: Deploy kea-dhcp4 configuration file
|
||||||
tags: [ kea, dhcp4 ]
|
|
||||||
become: true
|
become: true
|
||||||
when: kea_dhcp__dhcp4.enable
|
when: kea_dhcp__dhcp4.enable
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
@ -18,10 +16,9 @@
|
||||||
mode: "u=rw,g=r,o="
|
mode: "u=rw,g=r,o="
|
||||||
validate: kea-dhcp4 -T %s
|
validate: kea-dhcp4 -T %s
|
||||||
notify:
|
notify:
|
||||||
- Kea_dhcp4.reloaded
|
- Kea_dhcp4.restarted
|
||||||
|
|
||||||
- name: Deploy kea-dhcp6 configuration file
|
- name: Deploy kea-dhcp6 configuration file
|
||||||
tags: [ kea, dhcp6 ]
|
|
||||||
become: true
|
become: true
|
||||||
when: kea_dhcp__dhcp6.enable
|
when: kea_dhcp__dhcp6.enable
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
@ -33,10 +30,9 @@
|
||||||
mode: "u=rw,g=r,o="
|
mode: "u=rw,g=r,o="
|
||||||
validate: kea-dhcp6 -T %s
|
validate: kea-dhcp6 -T %s
|
||||||
notify:
|
notify:
|
||||||
- Kea_dhcp6.reloaded
|
- Kea_dhcp6.restarted
|
||||||
|
|
||||||
- name: Copy kea-ctrl-agent configuration file
|
- name: Copy kea-ctrl-agent configuration file
|
||||||
tags: [ kea, ctrl-agent ]
|
|
||||||
become: true
|
become: true
|
||||||
when: kea_dhcp__stork_agent.enable
|
when: kea_dhcp__stork_agent.enable
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
@ -47,5 +43,5 @@
|
||||||
mode: "u=rw,g=r,o="
|
mode: "u=rw,g=r,o="
|
||||||
validate: kea-ctrl-agent -t %s
|
validate: kea-ctrl-agent -t %s
|
||||||
notify:
|
notify:
|
||||||
- Kea_ctrl.reloaded
|
- Kea_ctrl.restarted
|
||||||
- Stork_agent.restarted
|
- Stork_agent.restarted
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Setup Kea DHCP
|
- name: Setup Kea DHCP
|
||||||
tags: [kea, dhcp]
|
|
||||||
block:
|
block:
|
||||||
- name: Install Kea on Archlinux
|
|
||||||
when: ansible_facts['distribution'] == "Archlinux"
|
|
||||||
ansible.builtin.import_tasks: install_archlinux.yml
|
|
||||||
|
|
||||||
- name: Install Kea on Debian
|
- name: Install Kea on Debian
|
||||||
when: ansible_facts['distribution'] == "Debian"
|
when: ansible_facts['distribution'] == "Debian"
|
||||||
ansible.builtin.import_tasks: install_debian.yml
|
ansible.builtin.import_tasks: install_debian.yml
|
||||||
|
bitwhisker marked this conversation as resolved
Outdated
june
commented
Again, getting rid of the Arch Linux logic also greatly simplifies this file. Again, getting rid of the Arch Linux logic also greatly simplifies this file.
bitwhisker
commented
this was just copied from the fux noc ansible, but I can remove it this was just copied from the fux noc ansible, but I can remove it
|
|||||||
|
|
@ -14,6 +9,5 @@
|
||||||
ansible.builtin.include_tasks: kea.yaml
|
ansible.builtin.include_tasks: kea.yaml
|
||||||
|
|
||||||
- name: Run stork-agent tasks
|
- name: Run stork-agent tasks
|
||||||
tags: [stork-agent, monitoring]
|
|
||||||
when: kea_dhcp__stork_agent.enable
|
when: kea_dhcp__stork_agent.enable
|
||||||
ansible.builtin.include_tasks: stork-agent.yaml
|
ansible.builtin.include_tasks: stork-agent.yaml
|
||||||
|
|
|
||||||
|
|
@ -1,55 +1,18 @@
|
||||||
---
|
---
|
||||||
- name: Install stork-agent
|
- name: Install stork-agent
|
||||||
tags: [stork-agent]
|
|
||||||
block:
|
block:
|
||||||
- name: Install stork-agent on Archlinux
|
- name: Install isc-stork-agent
|
||||||
when: ansible_facts['distribution'] == "Archlinux"
|
|
||||||
tags: [stork-agent, archlinux]
|
|
||||||
block:
|
|
||||||
- name: Create stork-agent user
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: stork-agent
|
|
||||||
create_home: false
|
|
||||||
home: "/var/lib/stork-agent"
|
|
||||||
shell: "/usr/bin/nologin"
|
|
||||||
system: true
|
|
||||||
groups: ["kea"]
|
|
||||||
append: true
|
|
||||||
|
|
||||||
- name: Install stork-agent with aur_pkg_install
|
|
||||||
ansible.builtin.include_role:
|
|
||||||
name: aur_pkg_install
|
|
||||||
vars:
|
|
||||||
aur_pkg_install__pkg_name: "stork-agent"
|
|
||||||
aur_pkg_install__git_clone_url: "https://ansible:{{ secret__ansible_git_token }}@git.fux-eg.net/aur-mirror/stork-agent.git"
|
|
||||||
aur_pkg_install__git_ref: "bf96e34"
|
|
||||||
|
|
||||||
- name: Install stork-agent on Debian
|
|
||||||
when: ansible_facts['distribution'] == "Debian"
|
when: ansible_facts['distribution'] == "Debian"
|
||||||
tags: [stork-agent, debian]
|
become: true
|
||||||
block:
|
ansible.builtin.apt:
|
||||||
- name: Register isc-stork apt repository
|
name: isc-stork-agent
|
||||||
become: true
|
|
||||||
register: "kea_dhcp_install_repo"
|
|
||||||
ansible.builtin.deb822_repository:
|
|
||||||
name: isc-stork
|
|
||||||
uris: https://dl.cloudsmith.io/public/isc/stork/deb/debian
|
|
||||||
suites: any-version
|
|
||||||
components: main
|
|
||||||
signed_by: https://dl.cloudsmith.io/public/isc/stork/gpg.key
|
|
||||||
|
|
||||||
- name: Install isc-stork-agent
|
|
||||||
become: true
|
|
||||||
ansible.builtin.apt:
|
|
||||||
name: isc-stork-agent
|
|
||||||
update_cache: "{{ kea_dhcp_install_repo.changed }}"
|
|
||||||
|
|
||||||
- name: Add stork-agent user to _kea group on Debian
|
- name: Add stork-agent user to _kea group on Debian
|
||||||
when: ansible_facts['distribution'] == "Debian"
|
when: ansible_facts['distribution'] == "Debian"
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: stork-agent
|
name: stork-agent
|
||||||
groups: ["_kea"]
|
groups: [ "_kea" ]
|
||||||
append: true
|
append: true
|
||||||
|
|
||||||
- name: Config for stork-agent
|
- name: Config for stork-agent
|
||||||
|
|
|
||||||
Called "reloaded" even tho the action is
restarted. One of them needs to be adjusted.