From: Warren Usui Date: Fri, 29 Jul 2016 05:00:35 +0000 (-0400) Subject: Add checks to make sure that the subscription manager is not already enabled. X-Git-Tag: v11.1.0~164^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e061d8d1483e7693ad3cfb037f4f106afce3c4d2;p=ceph.git Add checks to make sure that the subscription manager is not already enabled. Add ability to set monitor_interface and public_network values (as opposed to using hard coded values) This change should be squashed with the previous change before merging this pull request Signed-off-by: Warren Usui --- diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/README b/qa/qa_scripts/openstack/ceph_install_w_ansible/README index bed8bad56cf8..282c46e48101 100644 --- a/qa/qa_scripts/openstack/ceph_install_w_ansible/README +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/README @@ -1,3 +1,4 @@ + 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 @@ -9,6 +10,13 @@ secrets, (~/secrets), that contains the following lines: 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, diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/ceph_install.sh b/qa/qa_scripts/openstack/ceph_install_w_ansible/ceph_install.sh index 72f0db144bfb..76a2e8a64226 100755 --- a/qa/qa_scripts/openstack/ceph_install_w_ansible/ceph_install.sh +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/ceph_install.sh @@ -33,4 +33,7 @@ copy_file execs/ceph_ansible.sh $adminnode . 0777 ubuntu:ubuntu 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 diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh index 76cc07e4a3f7..5f2d05ac80df 100755 --- a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh @@ -2,11 +2,19 @@ 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 diff --git a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh index d25dc34a5e65..6a2a2ba5b92c 100755 --- a/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh +++ b/qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh @@ -6,6 +6,11 @@ cd 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 @@ -13,9 +18,9 @@ sudo sed -i 's/#ceph_stable:.*/ceph_stable: true/' 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