aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml
blob: ca85f4407d9be4964e14dca61194887702d63907 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#############################################################################
# Copyright (c) 2017 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
# #############################################################################
---
- name: modify the aodh haproxy config
  copy:
    dest: /opt/openstack-ansible/inventory/group_vars/all/haproxy.yml
    src: haproxy.yml
    mode: 0664

- name: add OS_AUTH_TYPE in openrc
  lineinfile:
    dest: /etc/ansible/roles/openstack_openrc/templates/openrc.j2
    line: "export OS_AUTH_TYPE=password"

- name: copy the ceilometer policy yaml
  copy:
    dest: /etc/ansible/roles/os_ceilometer/templates/policy.json.j2
    src: policy.json
    mode: 0664

- name: replace the ceilometer policy
  lineinfile:
    dest: /etc/ansible/roles/os_ceilometer/tasks/ceilometer_post_install.yml
    regexp: "ceilometer_policy_user_content"
    line: '      src: "policy.json.j2"'
    backrefs: "yes"

- name: modify the os-ceilometer-install.yml
  blockinfile:
    dest: /opt/openstack-ansible/playbooks/os-ceilometer-install.yml
    insertbefore: "common-tasks/package-cache-proxy.yml"
    block: |
      # create ceilometer db
          - include: common-tasks/mysql-db-user.yml
            static: no
            vars: {% raw %}
              user_name: "{{ ceilometer_galera_user }}"
              password: "{{ ceilometer_container_db_password }}"
              login_host: "{{ ceilometer_galera_address }}"
              db_name: "{{ ceilometer_galera_database }}"
            when: inventory_hostname == groups['ceilometer_all'][0]{% endraw %}

- name: modify the os-ceilometer-install.yml
  lineinfile:
    dest: /opt/openstack-ansible/playbooks/os-ceilometer-install.yml
    insertafter: "is_metal"
    line: "{{ item }}"
  with_items:
    - "    ceilometer_galera_user: ceilometer"
    - "    ceilometer_galera_database: ceilometer"

- name: modify the os-ceilometer-install.yml
  lineinfile:
    dest: /opt/openstack-ansible/playbooks/os-ceilometer-install.yml
    insertafter: "is_metal"
    line: '   {% raw %} ceilometer_galera_address: "{{ galera_address }}"{% endraw %}'

# yamllint disable rule:line-length
- name: change the ceilometer.conf.j2
  blockinfile:
    dest: /etc/ansible/roles/os_ceilometer/templates/ceilometer.conf.j2
    block: |
      [database]{% raw %}
      connection = mysql+pymysql://{{ ceilometer_galera_user }}:{{ ceilometer_container_db_password }}@{{ceilometer_galera_address }}/{{ ceilometer_galera_database }}?charset=utf86{% endraw %}
# yamllint enable rule:line-length

- name: make sure the directory exist
  file:
    dest: /etc/openstack_deploy/ceilometer
    state: directory
    mode: 0755

- name: copy the polling.yml
  copy:
    dest: /etc/openstack_deploy/ceilometer/polling.yaml
    src: polling.yaml
    mode: 0644