Skip to content

Commit

Permalink
Clean up colelctd role a bit
Browse files Browse the repository at this point in the history
- Clean up some typos.
- Pass the mysql.socket on the undercloud to the container.

Change-Id: I82d80ab63e3d838b024ed41ef969ae48e3cb64f3
Signed-off-by: Charles Short <chucks@redhat.com>
  • Loading branch information
Charles Short committed Nov 7, 2019
1 parent 07f564e commit 4138368
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions ansible/install/roles/collectd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
src: "{{ config_type }}.collectd.conf.j2"
dest: "{{ browbeat_containers_path }}/collectd-openstack/config/collectd.conf"

- name: Build and Run container using Docker (OSP < 15)
- name: Build and Run container
block:
- name: Set container_cli (OSP < 15)
set_fact:
Expand All @@ -85,21 +85,20 @@
container_cli: podman
when: rhosp_version is version('15.0', '>=')

- name: Build collectd-openstack container (Docker)
- name: Build collectd-openstack container
shell: |
{{ container_cli }} build -t collectd-openstack {{ browbeat_containers_path }}/collectd-openstack/
become: true
- name: Run collectd-openstack container (Docker)
- name: Run collectd-openstack container
shell: |
{{ container_cli }} rm -f collectd-{{ config_type }}
{{ container_cli }} run --name collectd-{{ config_type }} \
--network host --pid host \
--privileged -d \
-v /var/log/containers:/var/log/containers \
-v /dev:/dev \
{% if config_type == 'controller' %}
{% if config_type == 'controller' or config_type == 'undercloud' %}
-v /var/lib/mysql/mysql.sock:/var/lib/mysql/mysql.sock \
{% endif %}
collectd-openstack
become: yes

Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ PreCacheChain "PreCache"
<Database "keystone">
Driver "mysql"
DriverOption "host" "{{undercloud_ctlplane_ip_address.stdout}}"
DriverOption "user" "root"
DriverOption "password" "{{undercloud_mysql_password.stdout}}"
DriverOption "dbname" "keystone"
DriverOption "mysql_unix_socket" "/var/lib/mysql/mysql.sock"
Query token_count
</Database>
</Plugin>
Expand Down

0 comments on commit 4138368

Please sign in to comment.