start.yml 1.44 KB
Newer Older
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
52
53
54
55
56
57
58
59
---

- 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 certificates in cortex conf dir
  remote_user: cortex
  copy:
    src:  "{{ item }}"
    dest: "/etc/cortex/"
    mode: 0600
  with_items:
    - "{{playbook_dir}}/secrets/CA/private/{{ inventory_hostname }}.p12"
    - "{{playbook_dir}}/secrets/CA/issued/{{ inventory_hostname }}.crt"
    - "{{playbook_dir}}/secrets/CA/private/{{ inventory_hostname }}.key"
    - "{{playbook_dir}}/secrets/CA/cacerts.jks"
    - "{{playbook_dir}}/secrets/CA/ca.crt"

- name: Configure embedded Elasticsearch 6
  remote_user: root
  template:
    src: jvm.options.j2
    dest: /etc/elasticsearch/jvm.options

- name: Start embedded Elasticsearch 6
  remote_user: root
  command: "supervisorctl start elasticsearch"

- name: Configure Cortex
  remote_user: cortex
  template:
    src: application.conf.j2
    dest: /etc/cortex/application.conf

- name: Start Cortex
  remote_user: root
  command: "supervisorctl start cortex"

- name: Wait for Cortex
  remote_user: root
  wait_for:
    host: "{{groups['cortex'][0]}}"
    port: 9001
    state: started
    delay: 5

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