diff options
Diffstat (limited to 'build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh')
-rwxr-xr-x | build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh b/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh index d057d0aee..a5ca56c64 100755 --- a/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh +++ b/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh @@ -3,7 +3,8 @@ mkdir -p /var/log/puppet exec > >(tee -i /var/log/puppet/bootstrap_admin_node.log) exec 2>&1 -FUEL_RELEASE=$(grep release: /etc/fuel/version.yaml | cut -d: -f2 | tr -d '" ') +FUEL_RELEASE=$(cat /etc/fuel_release) +ASTUTE_YAML='/etc/fuel/astute.yaml' BOOTSTRAP_NODE_CONFIG="/etc/fuel/bootstrap_admin_node.conf" bs_build_log='/var/log/fuel-bootstrap-image-build.log' bs_status=0 @@ -48,6 +49,8 @@ update_done_message="We recommend reviewing and applying Maintenance Updates \ for this release of Mirantis OpenStack: \ https://docs.mirantis.com/openstack/fuel/fuel-${FUEL_RELEASE}/\ release-notes.html#maintenance-updates" +fuelmenu_fail_message="Fuelmenu was not able to generate '/etc/fuel/astute.yaml' file! \ +Please, restart it manualy using 'fuelmenu' command." function countdown() { local i @@ -211,6 +214,10 @@ done shopt -u nullglob ### OPNFV addition END +# Enable sshd +systemctl enable sshd +systemctl start sshd + if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then fuelmenu else @@ -232,9 +239,12 @@ if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then fi fi -# Enable sshd -systemctl enable sshd -systemctl start sshd +if [ ! -f "${ASTUTE_YAML}" ]; then + echo ${fuelmenu_fail_message} + fail +fi + +systemctl reload sshd # Enable iptables systemctl enable iptables.service @@ -283,19 +293,19 @@ make_ubuntu_bootstrap_stub () { } get_bootstrap_flavor () { - local ASTUTE_YAML='/etc/fuel/astute.yaml' python <<-EOF - from fuelmenu.fuelmenu import Settings - conf = Settings().read("$ASTUTE_YAML").get('BOOTSTRAP', {}) + from yaml import safe_load + with open("$ASTUTE_YAML", 'r') as f: + conf = safe_load(f).get('BOOTSTRAP', {}) print(conf.get('flavor', 'centos').lower()) EOF } get_bootstrap_skip () { - local ASTUTE_YAML='/etc/fuel/astute.yaml' python <<-EOF - from fuelmenu.fuelmenu import Settings - conf = Settings().read("$ASTUTE_YAML").get('BOOTSTRAP', {}) + from yaml import safe_load + with open("$ASTUTE_YAML", 'r') as f: + conf = safe_load(f).get('BOOTSTRAP', {}) print(conf.get('skip_default_img_build', False)) EOF } |