kolla-ansible_general_configuraion

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
kolla-ansible_general_configuraion [2024/09/30 05:06] – [배포 스크립트] koovkolla-ansible_general_configuraion [2025/02/24 02:36] (현재) – [배포 스크립트] koov
줄 98: 줄 98:
 <WRAP prewrap> <WRAP prewrap>
 <code bash> <code bash>
- 
 #!/bin/bash #!/bin/bash
  
 CURR="0" CURR="0"
-RELEASE="2023.1" +RELEASE="2024.1" 
-CEPH_IP="192.168.3.31" +TARGET="multinode"
 while true; do while true; do
  
-    echo "########## Openstack ${RELEASE} deployment ##########";+    echo "########################";
     echo -n "0) ping nodes"; if [ $CURR == 0 ]; then echo -n " <== Current"; fi; echo "";     echo -n "0) ping nodes"; if [ $CURR == 0 ]; then echo -n " <== Current"; fi; echo "";
     echo -n "1) bootstrap"; if [ $CURR == 1 ]; then echo -n " <== Current"; fi; echo "";     echo -n "1) bootstrap"; if [ $CURR == 1 ]; then echo -n " <== Current"; fi; echo "";
줄 120: 줄 118:
     echo -n "s) shutdown nodes"; if [ "$CURR" == "s" ]; then echo -n " <== Current"; fi; echo "";     echo -n "s) shutdown nodes"; if [ "$CURR" == "s" ]; then echo -n " <== Current"; fi; echo "";
     echo -n "c) ceph purging"; if [ "$CURR" == "c" ]; then echo -n " <== Current"; fi; echo "";     echo -n "c) ceph purging"; if [ "$CURR" == "c" ]; then echo -n " <== Current"; fi; echo "";
 +    echo -n "m) mariadb recovery"; if [ "$CURR" == "m" ]; then echo -n " <== Current"; fi; echo "";
     echo "exit) quit";     echo "exit) quit";
     echo "########################";     echo "########################";
줄 131: 줄 130:
  
         0) echo ping nodes...;         0) echo ping nodes...;
- ansible -i multinode all -m ping;+ ansible -i ${TARGET} all -m ping;
  ;;  ;;
  
         1) echo Bootstraping...;         1) echo Bootstraping...;
-        kolla-ansible -i ./multinode bootstrap-servers;+        kolla-ansible bootstrap-servers -i ./${TARGET};
         ;;         ;;
  
         2) echo Prechecking... ;         2) echo Prechecking... ;
-        kolla-ansible -i ./multinode prechecks;+        kolla-ansible prechecks -i ./${TARGET};
         ;;         ;;
  
         3) echo Deploying... ;         3) echo Deploying... ;
-        kolla-ansible -i ./multinode deploy;+        kolla-ansible deploy -i ./${TARGET};
         ;;         ;;
  
         4) echo post-deploy... ;         4) echo post-deploy... ;
-        kolla-ansible -i ./multinode post-deploy;+        kolla-ansible post-deploy -i ./${TARGET};
         ;;         ;;
  
         5) echo install client tools... ;         5) echo install client tools... ;
- echo "pip install python-openstackclient python-cinderclient python-glanceclient python-novaclient python-neutronclient python-ironicclient python-designateclient python-heatclient python-manilaclient  python-swiftclient -c https://releases.openstack.org/constraints/upper/${RELEASE}"; +        pip install python-openstackclient python-cinderclient python-glanceclient python-novaclient python-neutronclient python-ironicclient python-designateclient python-heatclient python-manilaclient  python-swiftclient -c https://releases.openstack.org/constraints/upper/${RELEASE};
- pip install python-openstackclient python-cinderclient python-glanceclient python-novaclient python-neutronclient python-ironicclient python-designateclient python-heatclient python-manilaclient  python-swiftclient -c https://releases.openstack.org/constraints/upper/${RELEASE};+
         ;;         ;;
  
줄 161: 줄 159:
         [Yy]* )          [Yy]* ) 
  ansible -m shell -a 'killall qemu-kvm' -i multinode compute;  ansible -m shell -a 'killall qemu-kvm' -i multinode compute;
-        kolla-ansible -i ./multinode destroy --yes-i-really-really-mean-it;+        kolla-ansible destroy -i ./${TARGET} --yes-i-really-really-mean-it;
  break;;  break;;
          [Nn]* ) break;;          [Nn]* ) break;;
줄 170: 줄 168:
  
         p) echo image purging..;         p) echo image purging..;
-        ansible -m shell -a 'docker rmi $(docker images -q)' -i multinode all;+        ansible -m shell -a 'docker rmi $(docker images -q)' -i ./${TARGET} all;
         ;;         ;;
  
         u) echo update os..;         u) echo update os..;
-        ansible -m shell -a 'yum -y update; sync;' -i multinode all;+        ansible -m shell -a 'yum -y update; sync;' -i ./${TARGET} all;
         ;;         ;;
  
  r) echo reboot nodes..;  r) echo reboot nodes..;
- ansible -m shell -a 'sync;reboot' -i multinode control; + ansible -m shell -a 'sync;reboot' -i ./${TARGET} control; 
- ansible -m shell -a 'sync;reboot' -i multinode compute;+ ansible -m shell -a 'sync;reboot' -i ./${TARGET} compute;
  ;;  ;;
  
  s) echo shutdown nodes..;  s) echo shutdown nodes..;
- ansible -m shell -a 'sync;shutdown -h now' -i multinode control; + ansible -m shell -a 'sync;shutdown -h now' -i ./${TARGET} control; 
- ansible -m shell -a 'sync;shutdown -h now' -i multinode compute;+ ansible -m shell -a 'sync;shutdown -h now' -i ./${TARGET} compute;
  ;;  ;;
  
  c) echo ceph purging..;  c) echo ceph purging..;
-        echo "ansible -m shell -a 'for i in `rados lspools`; do rados purge ${i} --yes-i-really-really-mean-it; done' -i '${CEPH_IP},' all"+        ansible -m shell -a 'for i in `rados lspools`; do rados purge ${i} --yes-i-really-really-mean-it; done' -i '192.168.41.31,' all 
-        ansible -m shell -a 'for in `rados lspools`; do rados purge ${i} --yes-i-really-really-mean-it; done' -i '${CEPH_IP},' all;+        ;
 + 
 +        m) echo MariaDB recovery.. ; 
 +        while true; do 
 +        read -p "Do you wish to run MariaDB Recovery? >" yn 
 +        case $yn in 
 +                [Yy]* ) 
 + cd ~; 
 + echo 'stop control1 mariadb container...'; 
 + ansible -m shell -a 'docker stop mariadb' -./${TARGETcontrol; 
 + if [ $? -eq 0 ]; then 
 + echo "mariadb stop successfully" 
 + kolla-ansible mariadb_recovery -i ./${TARGET}; 
 + else 
 + echo "mariadb stop failed" 
 + fi 
 + break;; 
 + 
 +                [Nn]* ) break;; 
 +                * ) echo "Please answer yes or no.";; 
 +        esac 
 +        done
         ;;         ;;
  
줄 195: 줄 214:
     esac     esac
 done done
- 
 </code> </code>
 </WRAP> </WRAP>
  • kolla-ansible_general_configuraion.1727672778.txt.gz
  • 마지막으로 수정됨: 2024/09/30 05:06
  • 저자 koov