blob: 11e2177a13971565b2bd7ce34c7bdf5e18142594 [file] [log] [blame]
Gary Wue5f3fc72017-08-04 07:09:26 -07001#!/bin/bash
2# This particular environment was created specifically for vfc-nfvo-lcm
3
4# vim: ts=4 sw=4 sts=4 et tw=72 :
5
6# force any errors to cause the script and job to end in failure
7set -xeu -o pipefail
8
9rh_systems() {
10 # redis
11 yum install redis
12 systemctl enable redis.service
13}
14
15ubuntu_systems() {
16 # redis
17
18 # 1. download and install redis
19 cd /tmp
20 wget http://download.redis.io/releases/redis-4.0.1.tar.gz
21 tar -zxf redis-4.0.1.tar.gz
22 cd /tmp/redis-4.0.1
23 make
24 make install
25
26 # 2. set conf file and init script
27 mv /tmp/redis-4.0.1/redis-server /etc/init.d/redis-server
28 chmod +x /etc/init.d/redis-server
29 mv /tmp/redis-4.0.1/redis.conf /etc/redis.conf
30
31 # 3. set auto start when start system
32 update-rc.d redis-server defaults
33}
34
35all_systems() {
36 echo 'No common distribution configuration to perform'
37}
38
39echo "---> Detecting OS"
40ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
41
42case "${ORIGIN}" in
43 fedora|centos|redhat)
44 echo "---> RH type system detected"
45 rh_systems
46 ;;
47 ubuntu)
48 echo "---> Ubuntu system detected"
49 ubuntu_systems
50 ;;
51 *)
52 echo "---> Unknown operating system"
53 ;;
54esac
55
56# execute steps for all systems
57all_systems