3 # vim: ts=4 sw=4 sts=4 et tw=72 :
6 # Handle the occurance where SELINUX is actually disabled
7 if [ `grep SELINUX=permissive /etc/selinux/config` ]; then
8 # make sure that the filesystem is properly labelled.
9 # it could be not fully labeled correctly if it was just switched
10 # from disabled, the autorelabel misses some things
11 # skip relabelling on /dev as it will generally throw errors
12 restorecon -R -e /dev /
14 # enable enforcing mode from the very start
17 # configure system for enforcing mode on next boot
18 sed -i 's/SELINUX=permissive/SELINUX=enforcing/' /etc/selinux/config
20 sed -i 's/SELINUX=disabled/SELINUX=permissive/' /etc/selinux/config
23 echo "*******************************************"
24 echo "** SYSTEM REQUIRES A RESTART FOR SELINUX **"
25 echo "*******************************************"
28 echo "---> Updating operating system"
32 # add in components we need or want on systems
33 echo "---> Installing base packages"
34 yum install -y -q @base unzip xz puppet git perl-XML-XPath
36 # All of our systems require Java (because of Jenkins)
37 # Install all versions of the OpenJDK devel but force 1.7.0 to be the
40 echo "---> Configuring OpenJDK"
41 yum install -y -q 'java-*-openjdk-devel'
42 alternatives --set java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
43 alternatives --set java_sdk_openjdk /usr/lib/jvm/java-1.7.0-openjdk.x86_64
47 # Ignore SELinux since slamming that onto Ubuntu leads to
50 echo "---> Updating operating system"
52 apt-get upgrade -y --force-yes -qq
54 # add in stuff we know we need
55 echo "---> Installing base packages"
56 apt-get install -y --force-yes -qq unzip xz-utils puppet git libxml-xpath-perl
59 echo "---> Configuring OpenJDK"
60 apt-get install -y --force-yes -qq openjdk-7-jdk
63 add-apt-repository -y ppa:openjdk-r/ppa
65 # We need to force openjdk-8-jdk to install
66 apt-get install -y -qq openjdk-8-jdk
68 # make sure that we still default to openjdk 7
69 update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
70 update-alternatives --set javac /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
74 # To handle the prompt style that is expected all over the environment
75 # with how use use robotframework we need to make sure that it is
76 # consistent for any of the users that are created during dynamic spin
78 echo 'PS1="[\u@\h \W]> "' >> /etc/skel/.bashrc
80 # Do any Distro specific installations here
81 echo "Checking distribution"
82 FACTER_OS=`/usr/bin/facter operatingsystem`
85 if [ `/usr/bin/facter operatingsystemrelease | /bin/cut -d '.' -f1` = "7" ]; then
88 echo "No extra steps currently for CentOS 7"
92 echo "Installing ODL YUM repo"
93 yum install -q -y https://nexus.opendaylight.org/content/repositories/opendaylight-yum-epel-6-x86_64/rpm/opendaylight-release/0.1.0-1.el6.noarch/opendaylight-release-0.1.0-1.el6.noarch.rpm
97 echo "---> $FACTER_OS found"
98 echo "No extra steps for $FACTER_OS"
103 echo "---> Attempting to detect OS"
105 if [ -f /usr/bin/yum ]
114 echo "---> RH type system detected"
118 echo "---> Ubuntu system detected"
122 echo "---> Unknown operating system"
126 # execute steps for all systems