summaryrefslogtreecommitdiffstats
path: root/roles/dns/tasks/main.yml
blob: 2abe0d9ddc7fe669bbccbee388c993484018574d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
- name: Install Bind
  package: name=bind state=present
  when: not openshift.common.is_containerized | bool

- name: Create docker build dir
  file: path=/tmp/dockerbuild state=directory
  when: openshift.common.is_containerized | bool

- name: Install dockerfile
  template:
    dest: "/tmp/dockerbuild/Dockerfile"
    src: Dockerfile
  register: install_result
  when: openshift.common.is_containerized | bool

- name: Build Bind image
  docker_image: path="/tmp/dockerbuild" name="bind" state=present
  when: openshift.common.is_containerized | bool

- name: Install bind service file
  template:
    dest: "/etc/systemd/system/named.service"
    src: named.service.j2
  register: install_result
  when: openshift.common.is_containerized | bool

- name: reload systemd
  command: /usr/bin/systemctl --system daemon-reload
  when: openshift.common.is_containerized | bool and install_result | changed

- name: Create bind zone dir
  file: path=/var/named state=directory
  when: openshift.common.is_containerized | bool

- name: Configure Bind
  template:
    src: "{{ item.src }}"
    dest: "{{ item.dest }}"
  with_items:
    - src: openshift-cluster.zone
      dest: /var/named/openshift-cluster.zone
    - src: named.conf
      dest: /etc/named.conf
  notify: restart bind

- name: Enable Bind
  service:
    name: named
    state: started
    enabled: yes