From 5368f76d29e955f0f9122c7f419aed305b9d2527 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Wed, 18 Apr 2018 13:25:09 -0400 Subject: [PATCH] Add repo for java-openjdk and install java This commit adds the centos7 base repo to be able to install java which is a dependency for collectd-java Change-Id: I23f35990b4216721b6a99a6d6296e68301d87df2 --- .../roles/collectd-openstack/tasks/main.yml | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/ansible/install/roles/collectd-openstack/tasks/main.yml b/ansible/install/roles/collectd-openstack/tasks/main.yml index 1f415a7b1..a98ac2bff 100644 --- a/ansible/install/roles/collectd-openstack/tasks/main.yml +++ b/ansible/install/roles/collectd-openstack/tasks/main.yml @@ -39,6 +39,24 @@ - collectd-turbostat - collectd-ping +# (sai) Since we moved to containers we don't have java installed on the host +# anymore but it is needed for collectd-java +- name: Add repository + yum_repository: + name: CentOS-7-Base + description: Core CentOS7 Packages + baseurl: http://mirror.centos.org/centos/7/os/$basearch/ + enabled: yes + become: true + register: repo_add + when: ('controller' in group_names and {{opendaylight_java_plugin}} == true) + +- name: Add key + rpm_key: + state: present + key: https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7 + become: true + # (sai) Separating out collectd java rpms as they have a lot of dependencies and # are only required for ODL monitoring on controllers only - name: Install collectd java specific rpms @@ -47,9 +65,17 @@ state: present become: true with_items: + - java-1.8.0-openjdk - collectd-java - collectd-generic-jmx - when: ('controller' in group_names and {{opendaylight_java_plugin}} == true) + when: (repo_add is success and 'controller' in group_names and {{opendaylight_java_plugin}} == true) + +- name: Remove repository + yum_repository: + name: CentOS-7-Base + state: absent + become: true + when: (repo_add is success and 'controller' in group_names and {{opendaylight_java_plugin}} == true) # Iostat plugin requires sysstat since shelling iostat for stats, Also it is # handy to have sysstat.