start.yml 1.51 KB
Newer Older
1
2
---

Arne Øslebø's avatar
Arne Øslebø committed
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: Copy cacert to ca-trust dir
  remote_user: root
  copy:
    src: "{{playbook_dir}}/secrets/CA/ca.crt"
    dest: /etc/pki/ca-trust/source/anchors/ca.crt

- name: Install cacert to root truststore
  remote_user: root
  command: "update-ca-trust"

- name: Copy certificate in thehive conf dir
  copy:
    src:  "{{playbook_dir}}/secrets/CA/issued/{{ inventory_hostname }}.crt"
    dest: "/etc/thehive/{{ inventory_hostname }}.crt"
    mode: 0600

- name: Copy certificate key in thehive conf dir
  copy:
    src:  "{{playbook_dir}}/secrets/CA/private/{{ inventory_hostname }}.key"
    dest: "/etc/thehive/{{ inventory_hostname }}.key"
    mode: 0600

- name: Copy CA certificates in thehive conf dir
  copy:
    src:  "{{playbook_dir}}/secrets/CA/{{ item }}"
    dest: "/etc/thehive/{{ item }}"
    mode: 0600
  with_items:
    - "cacerts.jks"
    - "ca.crt"

- name: Get openid authkey
  set_fact:
    thehivesecret: "{{lookup('file', '{{playbook_dir}}/secrets/tokens/thehivesecret',convert_data=False) | from_json}}"

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
- name: Configure TheHive
  remote_user: thehive
  template:
    src: application.conf.j2
    dest: /etc/thehive/application.conf

- name: Start TheHive
  remote_user: root
  command: "supervisorctl start thehive"

- name: Wait for TheHive
  remote_user: root
  wait_for:
    host: "{{groups['thehive'][0]}}"
    port: 9000
    state: started
    delay: 5

- name: Set Autostart for supervisord's services
  replace:
    path: /etc/supervisord.conf
    regexp: '^autostart=false$'
    replace: 'autostart=true'