7f5209c1d733c7236ab882e2abebf2b1da820542
[compass4nfv.git] /
1 ##############################################################################
2 # Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 ---
10 - include_vars: "{{ ansible_os_family }}.yml"
11
12 - name: update apache2 configs
13   template:
14     src: wsgi-ceilometer.conf.j2
15     dest: /etc/apache2/sites-available/ceilometer.conf
16   notify: reload apache server
17
18 - name: enable ceilometer server
19   file:
20     src: /etc/apache2/sites-available/ceilometer.conf
21     dest: /etc/apache2/sites-enabled/ceilometer.conf
22     state: "link"
23   when: ansible_os_family == 'Debian'
24   notify: reload apache server
25
26 - name: assure listen port exist
27   shell: echo "Listen {{ internal_ip }}:8777" >> /etc/apache2/ports.conf
28   notify:
29     - restart apache server
30
31 - name: copy glance & cinder configs
32   template:
33     src: "{{ item }}"
34     dest: /opt/os_templates
35   with_items:
36     - cinder.conf.j2
37     - glance-api.conf.j2
38     - glance-registry.conf.j2
39
40 - name: update configs
41   shell: crudini --merge {{ item.dest }} < /opt/os_templates/{{ item.src }}
42   with_items:
43     - src: cinder.conf.j2
44       dest: /etc/cinder/cinder.conf
45     - src: glance-api.conf.j2
46       dest: /etc/glance/glance-api.conf
47     - src: glance-registry.conf.j2
48       dest: /etc/glance/glance-registry.conf
49   notify: restart glance_cinder service
50
51 - name: delete configs
52   file:
53     path: /opt/os_templates/{{ item }}
54     state: absent
55   with_items:
56     - cinder.conf.j2
57     - glance-api.conf.j2
58     - glance-registry.conf.j2
59
60 - name: change meter polling interval to 300s
61   replace:
62     dest: /etc/ceilometer/pipeline.yaml
63     regexp: 'interval: .+'
64     replace: 'interval: 300'
65   notify: restart ceilometer service
66
67 - name: write services to monitor list
68   lineinfile: dest=/opt/service create=yes line='{{ item }}'
69   with_items: ceilometer_services
70
71 - meta: flush_handlers