+
ceph_install.sh installs a ceph cluster using the cdn and ceph-ansible.
Right now, it takes 5 parameters -- an admin node, a ceph mon node, and
subscrname=Your-Redhat-Cdn-Id
subscrpassword=Your-Redhat-Cdn-Password
+If you want to set the monitor_interface or the public_network values,
+in your home directory create a file named ip_info (~/ip_info), that
+contains the following lines:
+
+mon_intf=your-monitor-interface (default is eno1)
+pub_netw=public-network (default is 10.8.128.0/21)
+
This script first subscribes to the cdn, enables the rhel 7 repos, and does
a yum update. (multi_action.sh performs all the actions on all nodes at once,
staller.sh is used to make sure that all updates are complete before exiting,
copy_file execs/edit_ansible_hosts.sh $adminnode . 0777 ubuntu:ubuntu
copy_file execs/edit_groupvars_osds.sh $adminnode . 0777 ubuntu:ubuntu
copy_file ../execs/ceph-pool-create.sh $monnode . 0777 ubuntu:ubuntu
+if [ -e ~/ip_info ]; then
+ copy_file ~/ip_info $adminnode . 0777 ubuntu:ubuntu
+fi
ssh $adminnode ./ceph_ansible.sh $cephnodes
if [ -f ~/secrets ]; then
source ~/secrets
fi
-mynameis=${subscrname:-'inigomontoya'}
-mypassis=${subscrpassword:-'youkeelmyfatherpreparetodie'}
-sudo subscription-manager register --username=$mynameis --password=$mypassis --force
-sudo subscription-manager refresh
-if [ $? -eq 1 ]; then exit 1; fi
-sudo subscription-manager attach --pool=8a85f9823e3d5e43013e3ddd4e2a0977
+subm=`which subscription-manager`
+if [ ${#subm} -eq 0 ]; then
+ sudo yum -y update
+ exit
+fi
+subst=`sudo subscription-manager status | grep "^Overall" | awk '{print $NF}'`
+if [ $subst == 'Unknown' ]; then
+ mynameis=${subscrname:-'inigomontoya'}
+ mypassis=${subscrpassword:-'youkeelmyfatherpreparetodie'}
+ sudo subscription-manager register --username=$mynameis --password=$mypassis --force
+ sudo subscription-manager refresh
+ if [ $? -eq 1 ]; then exit 1; fi
+ sudo subscription-manager attach --pool=8a85f9823e3d5e43013e3ddd4e2a0977
+fi
sudo subscription-manager repos --enable=rhel-7-server-rpms
sudo yum -y update
sudo ./edit_ansible_hosts.sh $cephnodes
mkdir ceph-ansible-keys
cd /usr/share/ceph-ansible/group_vars/
+if [ -f ~/ip_info ]; then
+ source ~/ip_info
+fi
+mon_intf=${mon_intf:-'eno1'}
+pub_netw=${pub_netw:-'10.8.128.0\/21'}
sudo cp all.sample all
sudo sed -i 's/#ceph_origin:.*/ceph_origin: distro/' all
sudo sed -i 's/#fetch_directory:.*/fetch_directory: ~\/ceph-ansible-keys/' all
sudo sed -i 's/#ceph_stable_rh_storage:.*/ceph_stable_rh_storage: false/' all
sudo sed -i 's/#ceph_stable_rh_storage_cdn_install:.*/ceph_stable_rh_storage_cdn_install: true/' all
sudo sed -i 's/#cephx:.*/cephx: true/' all
-sudo sed -i 's/#monitor_interface:.*/monitor_interface: eno1/' all
+sudo sed -i "s/#monitor_interface:.*/monitor_interface: ${mon_intf}/" all
sudo sed -i 's/#journal_size:.*/journal_size: 1024/' all
-sudo sed -i 's/#public_network:.*/public_network: 10.8.128.0\/21/' all
+sudo sed -i "s/#public_network:.*/public_network: ${pub_netw}/" all
sudo cp osds.sample osds
sudo sed -i 's/#fetch_directory:.*/fetch_directory: ~\/ceph-ansible-keys/' osds
sudo sed -i 's/#crush_location:/crush_location:/' osds