Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | # vim: ts=4 sw=4 sts=4 et tw=72 : |
| 4 | |
| 5 | rh_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 | |
| 14 | ubuntu_systems() { |
| 15 | echo "---> Installing Redis" |
| 16 | # Install redis-server |
| 17 | apt install -y redis-server |
| 18 | } |
| 19 | |
| 20 | all_systems() { |
| 21 | echo 'No common distribution configuration to perform' |
| 22 | } |
| 23 | |
| 24 | echo "---> Detecting OS" |
| 25 | ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') |
| 26 | |
| 27 | case "${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 | ;; |
| 39 | esac |
| 40 | |
| 41 | # execute steps for all systems |
| 42 | all_systems |