jkilpatr 7e7c6230cb Refactor EPEL into a role
Fixes bug 1605228, where if the user installs epel-relase from the Centos7 default
packages rather than from the latest rpm online packages the latest epel-release
from the rpm installs on top of it but does not provide newer packages.

But that's not what you care about, the big change that comes with this bugfix is a
refactoring of every playbook that uses EPEL to all call a single role which both
installs epel and setups a handler to cleanup epel when the set of roles is done.

This unifies and cleans up what was previously two ways of installing EPEL, two
ways of disabling it all duplicating across more than half a dozen roles. Some of
of which used the epel_rpm variable some of which did not. The resulting combined
role still uses the rpm command and as such inherits some hackiness in an effort
to keep everything working as it was before just with better organization.

This has been tested with very playbook modified here against my own cloud. Don't
consider this final since trying to install every single one of these to a single
virtual undercloud generated lots of other problems, but none of them failed on EPEL
or package related issues.

Change-Id: Ic592a97875a9ec783519f618260713277589c83e
2016-07-21 15:58:37 -04:00

75 lines
1.8 KiB
YAML

---
#
# Install/run grafana-server for browbeat
#
- name: disable firewalld
service: name=firewalld state=stopped enabled=false
become: true
ignore_errors: true
- name: Install repo file for docker
copy:
src=docker.repo
dest=/etc/yum.repos.d/docker.repo
owner=root
group=root
mode=0644
become: true
- name: Install docker rpm
yum: name={{ item }} state=present
become: true
with_items:
- docker-engine
# Start docker service
- name: Setup docker service
service: name=docker state=started enabled=true
become: true
- name: ensure data directory exists
file: path={{ persistent_grafana_data_path }} state=directory mode=0777
- name: ensure docker overrides for carbon-cache
file: path=/etc/docker/grafana state=directory mode=0755
- name: Install docker-ps script
copy:
src=docker-ps-names.sh
dest=/usr/local/bin/docker-ps-names.sh
owner=root
group=root
mode=0755
become: true
- name: check active containers
command: /usr/local/bin/docker-ps-names.sh
register: docker_ps_a
- name: start grafana docker container
command: "{{item}}"
ignore_errors: true
with_items:
- docker kill grafana
- docker rm grafana
- docker run -d --name grafana -p {{ docker_grafana_port }}:3000 -v {{ persistent_grafana_data_path }}:/var/lib/grafana {{ grafana_docker_image }}
when: '"grafana" not in docker_ps_a.stdout'
- name: Setup grafana systemd config
template:
src=grafana-server.service.j2
dest=/etc/systemd/system/grafana-server.service
owner=root
group=root
mode=0644
become: true
register: systemd_grafana_needs_restart
- name: bounce systemd and grafana-server container
shell: /usr/bin/systemctl daemon-reload && /usr/bin/systemctl enable grafana-server && /usr/bin/systemctl restart grafana-server
become: true
when: systemd_grafana_needs_restart.changed