diff --git a/multi-node-aio-xenial-ansible/deploy-osa.sh b/multi-node-aio-xenial-ansible/deploy-osa.sh index c18bcb28..0fd2a649 100755 --- a/multi-node-aio-xenial-ansible/deploy-osa.sh +++ b/multi-node-aio-xenial-ansible/deploy-osa.sh @@ -107,7 +107,7 @@ if [[ "${PRE_CONFIG_OSA}" = true ]]; then osa_user_var_add glance_default_store 'glance_default_store: swift' # Propagate host proxy settings (if set) into /etc/environment in the targets - if [ -n "$http_proxy" ]; then + if [ ! -z ${http_proxy+x} ]; then osa_user_var_add proxy_env_url 'proxy_env_url: '${http_proxy} osa_user_var_add no_proxy_env 'no_proxy_env: "localhost,127.0.0.1,{{ internal_lb_vip_address }},{{ external_lb_vip_address }},{% for host in groups['\''all_containers'\''] %}{{ hostvars[host]['\''container_address'\''] }}{% if not loop.last %},{% endif %}{% endfor %}"' osa_user_var_add global_environment_variables 'global_environment_variables:' diff --git a/multi-node-aio-xenial-ansible/no-cobbler-configure-vms.sh b/multi-node-aio-xenial-ansible/no-cobbler-configure-vms.sh index 319d1cbd..96d4d76d 100644 --- a/multi-node-aio-xenial-ansible/no-cobbler-configure-vms.sh +++ b/multi-node-aio-xenial-ansible/no-cobbler-configure-vms.sh @@ -34,12 +34,15 @@ done # Ensure that all running VMs have an updated apt-cache with keys # and copy our http proxy settings into each VM (in the environment and apt.conf) for node in $(get_all_hosts); do - ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "mkdir -p /tmp/keys; \ - echo \"http_proxy=$http_proxy\" >> /etc/environment; \ - echo \"https_proxy=$https_proxy\" >> /etc/environment; \ - echo \"no_proxy=localhost,127.0.0.1,10.0.0.200\" >> /etc/environment; \ - echo \"Acquire::http::Proxy \\\"$http_proxy\\\";\" >> /etc/apt/apt.conf" - + if [ ! -z ${http_proxy+x} ]; then + ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "mkdir -p /tmp/keys; \ + echo \"http_proxy=$http_proxy\" >> /etc/environment; \ + echo \"https_proxy=$https_proxy\" >> /etc/environment; \ + echo \"no_proxy=localhost,127.0.0.1,10.0.0.200\" >> /etc/environment; \ + echo \"Acquire::http::Proxy \\\"$http_proxy\\\";\" >> /etc/apt/apt.conf" + else + ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "mkdir -p /tmp/keys" + fi for i in /etc/apt/apt.conf.d/00-nokey /etc/apt/sources.list /etc/apt/sources.list.d/* /tmp/keys/*; do if [[ -f "$i" ]]; then scp "$i" "10.0.0.${node#*":"}:$i" diff --git a/multi-node-aio-xenial-ansible/setup-host.sh b/multi-node-aio-xenial-ansible/setup-host.sh index e6849f3c..13577e56 100755 --- a/multi-node-aio-xenial-ansible/setup-host.sh +++ b/multi-node-aio-xenial-ansible/setup-host.sh @@ -42,7 +42,7 @@ fi # Install basic packages known to be needed apt-get update && apt-get install -y bridge-utils ifenslave libvirt-bin lvm2 openssh-server python2.7 qemu-kvm ansible virtinst virt-manager \ - vlan software-properties-common python-software-properties python-netaddr + vlan software-properties-common python-software-properties python-netaddr ntp qemu-utils lxc1 virtualenv if ! grep "^source.*cfg$" /etc/network/interfaces; then echo 'source /etc/network/interfaces.d/*.cfg' | tee -a /etc/network/interfaces diff --git a/multi-node-aio-xenial-ansible/setup-pxeboot.sh b/multi-node-aio-xenial-ansible/setup-pxeboot.sh index a3dccb18..56a198da 100644 --- a/multi-node-aio-xenial-ansible/setup-pxeboot.sh +++ b/multi-node-aio-xenial-ansible/setup-pxeboot.sh @@ -25,5 +25,10 @@ source functions.rc ansible-playbook -v -i inventory create_pxeboot_server.yml --extra-vars \ "vm_disk_device=${DEVICE_NAME} ssh_key=\"${SSHKEY}\" vm_net_iface=${DEFAULT_NETWORK}" sed -i 's/^INTERFACES.*/INTERFACES="br-dhcp"/g' /etc/default/isc-dhcp-server + +# Ensure the services are (re)started +service isc-dhcp-server restart +service atftpd restart + # Create a xenial sources file for the VMs to download cp -v templates/xenial-sources.list /var/www/html/xenial-sources.list diff --git a/multi-node-aio-xenial-ansible/variables.sh b/multi-node-aio-xenial-ansible/variables.sh index 2a330ed4..0cf059b8 100755 --- a/multi-node-aio-xenial-ansible/variables.sh +++ b/multi-node-aio-xenial-ansible/variables.sh @@ -1,67 +1,67 @@ # Variables used by multi-node-aio # Network subnet used for all the virtual machines -NETWORK_BASE=10.29 +NETWORK_BASE="${NETWORK_BASE:-10.29}" # DNS used throughout the deploy DNS_NAMESERVER=$(cat /etc/resolv.conf | grep -m 1 "nameserver" | sed "s/nameserver //") -#DNS_NAMESERVER=8.8.8.8 +#DNS_NAMESERVER="${DNS_NAMESERVER:-8.8.8.8}" # By default AIO deploy overrides apt-sources, if things like a local mirror are already # set up then this script will override these. This option allows for the override to be # disabled. -OVERRIDE_SOURCES=false +OVERRIDE_SOURCES="${OVERRIDE_SOURCES:-false}" # What branch of Openstack-Ansible are we deploying from -OSA_BRANCH=stable/newton +OSA_BRANCH="${OSA_BRANCH:-stable/newton}" # What is the default disk device name -DEVICE_NAME=vda +DEVICE_NAME="${DEVICE_NAME:-vda}" # What default network device should we use -DEFAULT_NETWORK=ens3 +DEFAULT_NETWORK="${DEFAULT_NETWORK:-ens3}" # What is the default virtual machine disk size in GB -VM_DISK_SIZE=252 +VM_DISK_SIZE="${VM_DISK_SIZE:-252}" # Do we want to do all the required host setup -SETUP_HOST=true +SETUP_HOST="${SETUP_HOST:-true}" # What fisk shall we use for the default data -DATA_DISK_DEVICE=sdb +DATA_DISK_DEVICE="${DATA_DISK_DEVICE:-sdb}" # Do we want to do disk partitioning or is there a partition ready to use -PARTITION_HOST=true +PARTITION_HOST="${PARTITION_HOST:-true}" # Force partition - If the above variable is set to -F then we will use the force # option of MKFS so there is no confirm FORCE_PARTITION="-F" # Do we want to set up networking on the host for Virsh -SETUP_VIRSH_NET=true +SETUP_VIRSH_NET="${SETUP_VIRSH_NET:-true}" # When the virtual machines are re-kicked do we format them -VM_IMAGE_CREATE=true +VM_IMAGE_CREATE="${VM_IMAGE_CREATE:-true}" # Should we run the deploy Openstack-Ansible script at the end of the build script -DEPLOY_OSA=true +DEPLOY_OSA="${DEPLOY_OSA:-true}" # Should we pre-configure the environment before we deploy OpenStack-Ansible -PRE_CONFIG_OSA=true +PRE_CONFIG_OSA="${PRE_CONFIG_OSA:-true}" # Should we run the final deploy of OpenStack-Ansible -RUN_OSA=true +RUN_OSA="${RUN_OSA:-true}" # Should we use PXEboot -SETUP_PXEBOOT=true +SETUP_PXEBOOT="${SETUP_PXEBOOT:-true}" # Should we create the virtual machines -CREATE_VMS=true +CREATE_VMS="${CREATE_VMS:-true}" # Should we configure the virtual machines -CONFIGURE_VMS=true +CONFIGURE_VMS="${CONFIGURE_VMS:-true}" # Container vms - override the container virtual machines with xenial -CONTAINER_VMS=xenial +CONTAINER_VMS="${CONTAINER_VMS:-xenial}" # Ethernet type, this needs to be ens for Xenial and is for # templates/network-interfaces/vm.openstackci.local-bonded-bridges.cfg file -ETH_TYPE=ens +ETH_TYPE="${ETH_TYPE:-ens}"