]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add checks to make sure that the subscription manager is not already enabled. 10402/head
authorWarren Usui <wusui@magna002.ceph.redhat.com>
Fri, 29 Jul 2016 05:00:35 +0000 (01:00 -0400)
committerWarren Usui <wusui@magna002.ceph.redhat.com>
Fri, 29 Jul 2016 16:53:20 +0000 (12:53 -0400)
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 <wusui@magna002.ceph.redhat.com>
qa/qa_scripts/openstack/ceph_install_w_ansible/README
qa/qa_scripts/openstack/ceph_install_w_ansible/ceph_install.sh
qa/qa_scripts/openstack/ceph_install_w_ansible/execs/cdn_setup.sh
qa/qa_scripts/openstack/ceph_install_w_ansible/execs/ceph_ansible.sh

index bed8bad56cf866164c6a4a2dd052c1a2b871f877..282c46e48101204e458d567066e0a1fe1e1205ee 100644 (file)
@@ -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,
index 72f0db144bfb3c105cc6d4e464fce5e9dd115694..76a2e8a64226e91133b53293ee7cf5bca6e20d94 100755 (executable)
@@ -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
index 76cc07e4a3f70558ea8b342751d4591f8b7aa6fd..5f2d05ac80df9de27645d745eb315122a3f0cf81 100755 (executable)
@@ -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
index d25dc34a5e65919a8c94a15d523b571fc8d48746..6a2a2ba5b92c6a42fd36c3de6bbc792b51c02c3e 100755 (executable)
@@ -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