summaryrefslogtreecommitdiff
path: root/roles/haproxy/tasks/main.yml
blob: 2161b3b6fb541c1977f617355aaa6e840c22d9d8 (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
- name: install haproxy
  apt:
    name: haproxy

- name: create config dir
  file:
    state: directory
    path: "{{ item }}"
    owner: root
    group: root
    mode: 0755
  with_items:
    - /etc/haproxy

- name: install haproxy config
  template:
    src: haproxy.cfg.j2
    dest: /etc/haproxy/haproxy.cfg
    owner: root
    group: root
    mode: 0644

- name: install TLS certificate
  copy:
    content: "{{ tls_certificate }}"
    dest: /etc/ssl/ick.pem
    owner: root
    group: root
    mode: 0600

- name: enable and start haproxy
  service:
    name: "{{ item }}"
    state: restarted
    enabled: yes
  with_items:
    - haproxy