summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml
blob: c785ad42e4c34778dd3e7a1f90984526aaec8864 (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
62
63
64
65
66
67
68
69
##############################################################################
# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
#- 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']

- 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']

- 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"