|
1 |
| -#! /bin/bash |
| 1 | +echo "#! /bin/bash" > rmt-swift.sh |
2 | 2 |
|
3 |
| -if [ "$HOSTENV" == "rhel" ] && [ "$INSTALL_SWIFT" == "Y" ] |
4 |
| -then |
5 |
| - echo "...Remotely Installing OpenStack Swift and Clients" |
6 | 3 |
|
7 |
| - # enable full OSE repos for Swift |
8 |
| - echo "subscription-manager repos --enable=\"rhel-7-server-ose-$OCPVERSION-rpms\"> /dev/null" > rmt-swift.sh |
| 4 | +# enable full OSE repos for Swift |
| 5 | +echo "subscription-manager repos --enable=\"rhel-7-server-ose-$OCPVERSION-rpms\"> /dev/null" >> rmt-swift.sh |
9 | 6 |
|
10 |
| - echo "yum install openstack-swift-* -y> /dev/null" >> rmt-swift.sh |
11 |
| - echo "yum install python-scandir python-prettytable git -y> /dev/null" >> rmt-swift.sh |
| 7 | +echo "yum install openstack-swift-* -y> /dev/null" >> rmt-swift.sh |
| 8 | +echo "yum install python-scandir python-prettytable git -y> /dev/null" >> rmt-swift.sh |
12 | 9 |
|
13 |
| - echo "cd /opt" >> rmt-swift.sh |
14 |
| - echo "git clone https://github.com/gluster/gluster-swift" >> rmt-swift.sh |
15 |
| - echo "cd gluster-swift" >> rmt-swift.sh |
16 |
| - echo "python setup.py install" >> rmt-swift.sh |
| 10 | +echo "cd /opt" >> rmt-swift.sh |
| 11 | +echo "git clone https://github.com/gluster/gluster-swift" >> rmt-swift.sh |
| 12 | +echo "cd gluster-swift" >> rmt-swift.sh |
| 13 | +echo "python setup.py install" >> rmt-swift.sh |
| 14 | + |
| 15 | +echo "mkdir -p /etc/swift/" >> rmt-swift.sh |
| 16 | +echo "cp etc/* /etc/swift/" >> rmt-swift.sh |
| 17 | +echo "cd /etc/swift" >> rmt-swift.sh |
17 | 18 |
|
18 |
| - echo "mkdir -p /etc/swift/" >> rmt-swift.sh |
19 |
| - echo "cp etc/* /etc/swift/" >> rmt-swift.sh |
20 |
| - echo "cd /etc/swift" >> rmt-swift.sh |
| 19 | +echo "for tmpl in *.conf-gluster ; do cp \${tmpl} \${tmpl%.*}.conf; done" >> rmt-swift.sh |
| 20 | +echo "gluster-swift-gen-builders $GFS_VOLNAME" >> rmt-swift.sh |
21 | 21 |
|
22 |
| - echo "for tmpl in *.conf-gluster ; do cp \${tmpl} \${tmpl%.*}.conf; done" >> rmt-swift.sh |
23 |
| - echo "gluster-swift-gen-builders $GFS_VOLNAME" >> rmt-swift.sh |
| 22 | +# Install swiftclient and memcached |
| 23 | +echo "yum install python-swiftclient memcached -y> /dev/null" >> rmt-swift.sh |
24 | 24 |
|
25 |
| - # Install swiftclient and memcached |
26 |
| - echo "yum install python-swiftclient memcached -y> /dev/null" >> rmt-swift.sh |
| 25 | +echo "systemctl start memcached" >> rmt-swift.sh |
| 26 | +echo "systemctl enable memcached" >> rmt-swift.sh |
27 | 27 |
|
28 |
| - echo "systemctl start memcached" >> rmt-swift.sh |
29 |
| - echo "systemctl enable memcached" >> rmt-swift.sh |
| 28 | +# For security, add -U 0 to OPTIONS in /etc/sysconfig/memcached |
| 29 | +echo "sed -i \"s/OPTIONS=\"\"/OPTIONS=\"-U 0\"/\" /etc/sysconfig/memcached" >> rmt-swift.sh |
| 30 | +echo "systemctl restart memcached" >> rmt-swift.sh |
30 | 31 |
|
31 |
| - # For security, add -U 0 to OPTIONS in /etc/sysconfig/memcached |
32 |
| - echo "sed -i \"s/OPTIONS=\"\"/OPTIONS=\"-U 0\"/\" /etc/sysconfig/memcached" >> rmt-swift.sh |
33 |
| - echo "systemctl restart memcached" >> rmt-swift.sh |
| 32 | +if [ "$ADD_SWIFT3" == "Y" ] |
| 33 | +then |
| 34 | + echo "wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz --no-check-certificate" >> rmt-swift.sh |
| 35 | + echo "tar xzf setuptools-7.0.tar.gz; cd setuptools-7.0" >> rmt-swift.sh |
| 36 | + echo "python setup.py install" >> rmt-swift.sh |
| 37 | + echo "wget https://bootstrap.pypa.io/get-pip.py" >> rmt-swift.sh |
| 38 | + echo "python get-pip.py" >> rmt-swift.sh |
| 39 | + echo "pip install --upgrade requests" >> rmt-swift.sh |
34 | 40 |
|
| 41 | + echo "git clone https://github.com/openstack/swift3; cd swift3/" >> rmt-swift.sh |
| 42 | + echo "sed -i '1s/.*/ /' requirements.txt" >> rmt-swift.sh |
| 43 | + echo "sed -i '3s/.*/ /' requirements.txt" >> rmt-swift.sh |
| 44 | + echo "python setup.py install" >> rmt-swift.sh |
35 | 45 | fi
|
| 46 | + |
| 47 | +# copy config files |
| 48 | +echo "cd /opt/gluster-swift/conf" >> rmt-swift.sh |
| 49 | +echo "cp account-server.conf container-server.conf proxy-server.conf object-server.conf /etc/swift/." >> rmt-swift.sh |
| 50 | +echo "cp webhook.py /usr/lib/python2.7/site-packages/swift/common/middleware/." >> rmt-swift.sh |
0 commit comments