configure.yml 1.31 KB
Newer Older
1

2 3
- import_tasks: _init.yml

4 5 6 7
- import_role:
    name: package.dhcp
    tasks_from: configure

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

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

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

23
- name: install ISC Kea control agent configuration
24 25
  template:
    src: "{{ kea_control_agent_config }}"
26 27 28 29 30 31 32 33
    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"
34

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

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