ansible-infra/roles/kea_dhcp/tasks/stork-agent.yaml
bitwhisker bbf45e91f4
rt1(z9 host) unbound(role) kea_dhcp(role): create unbound and kea_dhcp role for rt1
- create unbound role
- create kea_dhcp role
- configure unbound and keadhcp on rt1(z9 host)
2026-05-26 10:21:28 +02:00

76 lines
2.4 KiB
YAML

---
- name: Install stork-agent
tags: [stork-agent]
block:
- name: Install stork-agent on Archlinux
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"
tags: [stork-agent, debian]
block:
- name: Register isc-stork apt repository
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
when: ansible_facts['distribution'] == "Debian"
become: true
ansible.builtin.user:
name: stork-agent
groups: ["_kea"]
append: true
- name: Config for stork-agent
ansible.builtin.template:
src: stork-agent.env.jinja
dest: /etc/stork/agent.env
owner: root
group: root
mode: "0660"
notify:
- Systemd_daemon_reload
- Stork_agent.restarted
- name: Flush handlers
ansible.builtin.meta: flush_handlers
- name: Ensure that stork kea exporter is working
ansible.builtin.uri:
url: "http://localhost:9547/metrics"
method: GET
register: kea_dhcp_stork_status_code
retries: 6
delay: 5
until: kea_dhcp_stork_status_code.status == 200