blob: 9a29b9547b2c15b2892221f63c95374709116c01 [file] [log] [blame]
Andrew Grimbergebc710a2017-01-30 12:59:38 -08001#!/bin/bash
2
3# vim: ts=4 sw=4 sts=4 et tw=72 :
4
5rh_systems() {
6 echo "---> Installing IUS repo and Redis"
7 # make sure that IUS is installed
8 yum install -y https://centos7.iuscommunity.org/ius-release.rpm
9 # now install redis 3.2.x
10 yum install -y redis32u
11 systemctl enable redis
12}
13
14ubuntu_systems() {
15 echo "---> Installing Redis"
16 # Install redis-server
17 apt install -y redis-server
18}
19
20all_systems() {
21 echo 'No common distribution configuration to perform'
22}
23
24echo "---> Detecting OS"
25ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
26
27case "${ORIGIN}" in
28 fedora|centos|redhat)
29 echo "---> RH type system detected"
30 rh_systems
31 ;;
32 ubuntu)
33 echo "---> Ubuntu system detected"
34 ubuntu_systems
35 ;;
36 *)
37 echo "---> Unknown operating system"
38 ;;
39esac
40
41# execute steps for all systems
42all_systems