aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml
blob: 3da783e19496c4350f3bd1d996f7e1837aeca851 (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
52
53
54
55
56
57
58
59
60
61
---
#- hosts: control
#  sudo: yes
#  tasks:
- name: "enable supervisor control"
  file:
    path: "/etc/init/supervisor-control.override"
    state: "absent"

- name: "enable supervisor dns"
  file:
    path: "/etc/init/supervisor-dns.override"
    state: "absent"

- name: "modify ifmap server basicauthusers properties for control"
  lineinfile:
    dest: "/etc/ifmap-server/basicauthusers.properties"
#    line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}"
    line: "{{ haproxy_hosts[item] }}:{{ haproxy_hosts[item] }}"
  with_items: groups['opencontrail_control']

- name: "modify ifmap server basicauthusers properties for dns"
  lineinfile:
    dest: "/etc/ifmap-server/basicauthusers.properties"
#    line: "{{ hostvars[item]['contrail_address' ] }}.dns:{{ hostvars[item]['contrail_address' ] }}.dns"
    line: "{{ haproxy_hosts[item] }}.dns:{{ haproxy_hosts[item] }}.dns"
  with_items: groups['opencontrail_control']

- name: "node-common"
  include: -node-common.yml

- name: "fix up contrail control config"
  template:
    src: "../../templates/provision/contrail-control-conf.j2"
    dest: "/etc/contrail/contrail-control.conf"

- name: "fix up contrail dns config"
  template:
    src: "../../templates/provision/contrail-dns-conf.j2"
    dest: "/etc/contrail/contrail-dns.conf"

- name: "fix up contrail control nodemgr config"
  ini_file:
    dest: "/etc/contrail/contrail-control-nodemgr.conf"
    section: "DISCOVERY"
    option: "server"
    value: "{{ contrail_haproxy_address }}"

- name: "modify dns configuration"
  replace:
    dest: "/etc/contrail/dns/{{ item }}"
    regexp: "secret \"secret123\""
    replace: "secret \"xvysmOR8lnUQRBcunkC6vg==\""
  with_items:
    - "contrail-rndc.conf"
    - "contrail-named.conf"

- name: "restart supervisor control"
  service:
    name: "supervisor-control"
    state: "restarted"