configure.yml 1.28 KB
Newer Older
1 2 3 4 5

- import_role:
    name: package.dhcp
    tasks_from: configure

6 7 8 9 10 11
- name: create ISC Kea Logger directory
  file:
    path: "{{ kea_logger_directory }}"
    state: directory

- name: install ISC Kea DHCPv4 configuration
12 13 14 15
  template:
    src: "{{ kea_dhcp4_config }}"
    dest: "{{ system_config_directory }}/kea/kea-dhcp4.conf"

16
- name: install ISC Kea DHCPv6 configuration
17 18 19 20
  template:
    src: "{{ kea_dhcp6_config }}"
    dest: "{{ system_config_directory }}/kea/kea-dhcp6.conf"

21
- name: install ISC Kea control agent configuration
22 23
  template:
    src: "{{ kea_control_agent_config }}"
24 25 26 27 28 29 30 31
    dest: "{{ system_config_directory }}/kea/kea-ctrl-agent.conf"

- name: Workaround to start within a FreeBSD jail container
  lineinfile:
    path: "{{ system_config_directory }}/rc.d/kea"
    regexp: "^# KEYWORD: nojail"
    line: "# KEYWORD: shutdown"
  when: ansible_distribution == "FreeBSD"
32

33
- name: start ISC Kea service
34 35 36 37 38 39 40 41
  service:
    name: "{{ service }}"
    state: started
  loop: "{{ package_services[os.distribution | lower()] }}"
  loop_control:
    loop_var: service
  register: keastart

42
- name: reload ISC Kea service
43 44 45 46 47 48 49
  service:
    name: "{{ service }}"
    state: reloaded
  loop: "{{ package_services[os.distribution | lower()] }}"
  loop_control:
    loop_var: service
  when: keastart.changed == False