Add deploy node to multinode-aio enviroment.
Add deploy node into the multinode-aio env, move the deployment and HAproxy into it, and NAT the port 22, 80, 443 into the deploy node. Change-Id: I7c886f213e6b3398cb4ecbc36a4ee55fb7f7fd10
This commit is contained in:
parent
08c6377645
commit
06f1368490
@ -38,4 +38,4 @@ DEPLOY_VMS=${DEPLOY_VMS:-true}
|
||||
|
||||
# Instruct the system to deploy OpenStack Ansible
|
||||
DEPLOY_OSA=${DEPLOY_OSA:-true}
|
||||
[[ "${DEPLOY_OSA}" = true ]] && source deploy-osa.sh
|
||||
[[ "${DEPLOY_OSA}" = true ]] && source config-deploy-node.sh
|
||||
|
26
multi-node-aio/config-deploy-node.sh
Executable file
26
multi-node-aio/config-deploy-node.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Load all functions
|
||||
source functions.rc
|
||||
|
||||
# bring in variable definitions if there is a variables.sh file
|
||||
[[ -f variables.sh ]] && source variables.sh
|
||||
|
||||
# Copy private key and public key to deploy node
|
||||
scp -r -o StrictHostKeyChecking=no ~/.ssh deploy1:/root/
|
||||
|
||||
# Copy multi-node-aio folder to deploy node
|
||||
scp -r -o StrictHostKeyChecking=no ../multi-node-aio deploy1:/root
|
||||
|
||||
# Deploy openstack-ansible from deploy node and export all variables deploy-osa.sh needs
|
||||
ssh -o StrictHostKeyChecking=no deploy1 "export NETWORK_BASE=${NETWORK_BASE} RUN_OSA=${RUN_OSA}
|
||||
OSA_BRANCH=${OSA_BRANCH} PRE_CONFIG_OSA=${PRE_CONFIG_OSA}; apt update; cd /root/multi-node-aio/; ./deploy-osa.sh"
|
||||
|
||||
# Add 2222 rules to iptables for ssh directly into deployment node.
|
||||
iptables_filter_rule_add nat 'PREROUTING -p tcp --dport 2222 -j DNAT --to 10.0.0.150:22'
|
||||
|
||||
scp -o StrictHostKeyChecking=no deploy1:/opt/openstack-ansible/playbooks/vars/configs/haproxy_config.yml .
|
||||
PORTS="$(get_osad_ports) $OSA_PORTS"
|
||||
for port in $PORTS ; do
|
||||
iptables_filter_rule_add nat "PREROUTING -p tcp --dport ${port} -j DNAT --to 10.0.0.150:${port}"
|
||||
done
|
@ -71,9 +71,35 @@ for node in $(get_all_hosts); do
|
||||
if [[ "14.04" != "${RELEASE_VERSION:0:5}" ]]; then
|
||||
ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "mv /tmp/sources.list /etc/apt/sources.list"
|
||||
fi
|
||||
ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "(for i in /tmp/keys/*; do \
|
||||
ssh -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "(for i in /tmp/keys/*; do \
|
||||
apt-key add \$i; \
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys \$(basename \$i); done); \
|
||||
apt-get clean; \
|
||||
apt-get update"
|
||||
done
|
||||
|
||||
# Add node hostname into /etc/hosts
|
||||
if ! grep -q "10.0.0.150" /etc/hosts; then
|
||||
for node_type in $(get_all_types); do
|
||||
for node in $(get_host_type ${node_type}); do
|
||||
echo "10.0.0.${node#*":"} ${node%%':'*}" >> /etc/hosts
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
# Add autocomplete ssh via /etc/hosts and ssh_config to all nodes
|
||||
for node in $(get_all_hosts); do
|
||||
echo '
|
||||
_complete_hosts () {
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
host_list=`{
|
||||
sed -n -e "s/^[0-9][0-9\.]*//p" /etc/hosts; }|tr " " "\n"|grep -v "*"`
|
||||
COMPREPLY=( $(compgen -W "\${host_list}" -- $cur))
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _complete_hosts host
|
||||
complete -F _complete_hosts ssh
|
||||
' | ssh -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "cat >> /root/.bashrc"
|
||||
done
|
@ -239,3 +239,16 @@ contains() {
|
||||
echo 1 # $substring is in $string
|
||||
fi
|
||||
}
|
||||
|
||||
# Return all service ports
|
||||
function get_osad_ports {
|
||||
python <<EOL
|
||||
import yaml
|
||||
with open('haproxy_config.yml') as f:
|
||||
x = yaml.safe_load(f.read())
|
||||
for i in x['haproxy_default_services']:
|
||||
y = i['service'].get('haproxy_port')
|
||||
if isinstance(y, int):
|
||||
print y
|
||||
EOL
|
||||
}
|
@ -3,21 +3,24 @@
|
||||
"infra1": "100",
|
||||
"infra2": "101",
|
||||
"infra3": "102"
|
||||
},
|
||||
"logging": {
|
||||
"logging1": "110"
|
||||
},
|
||||
"nova_compute": {
|
||||
"compute1": "120",
|
||||
"compute2": "121"
|
||||
},
|
||||
"cinder": {
|
||||
"cinder1": "130",
|
||||
"cinder2": "131"
|
||||
},
|
||||
"swift": {
|
||||
"swift1": "140",
|
||||
"swift2": "141",
|
||||
"swift3": "142"
|
||||
}
|
||||
},
|
||||
"logging": {
|
||||
"logging1": "110"
|
||||
},
|
||||
"nova_compute": {
|
||||
"compute1": "120",
|
||||
"compute2": "121"
|
||||
},
|
||||
"cinder": {
|
||||
"cinder1": "130",
|
||||
"cinder2": "131"
|
||||
},
|
||||
"swift": {
|
||||
"swift1": "140",
|
||||
"swift2": "141",
|
||||
"swift3": "142"
|
||||
},
|
||||
"deploy": {
|
||||
"deploy1":"150"
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ used_ips:
|
||||
- "__NETWORK_BASE__.248.0,__NETWORK_BASE__.248.200"
|
||||
|
||||
global_overrides:
|
||||
internal_lb_vip_address: __NETWORK_BASE__.236.200
|
||||
internal_lb_vip_address: __NETWORK_BASE__.236.150
|
||||
# The external IP is quoted simply to ensure that the .aio file can be used as input
|
||||
# dynamic inventory testing.
|
||||
external_lb_vip_address: "__HOSTIP__"
|
||||
@ -72,4 +72,4 @@ global_overrides:
|
||||
|
||||
haproxy_hosts:
|
||||
loadbalancer1:
|
||||
ip: __NETWORK_BASE__.236.200
|
||||
ip: __NETWORK_BASE__.236.150
|
||||
|
@ -0,0 +1,296 @@
|
||||
#
|
||||
# Ubuntu Server 14.04 Preseed
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# This Ubuntu Preseed file is meant to be used with Cobbler. It has been
|
||||
# tested only on Cobbler 2.4.1. It is a completely unattended install.
|
||||
#
|
||||
# References:
|
||||
#
|
||||
# https://help.ubuntu.com/14.04/installation-guide/example-preseed.txt
|
||||
# http://www.claudiokuenzler.com/blog/513/debian-ubuntu-preseed-create-two-volume-groups-same-disk
|
||||
|
||||
#############
|
||||
#
|
||||
# Kernel Options
|
||||
#
|
||||
#############
|
||||
|
||||
# Use the following option to add additional boot parameters for the
|
||||
# installed system (if supported by the bootloader installer).
|
||||
# Note: options passed to the installer will be added automatically.
|
||||
d-i debian-installer/add-kernel-opts string $kernel_options_post
|
||||
|
||||
### Base system installation
|
||||
d-i base-installer/kernel/image string __DEFAULT_KERNEL__
|
||||
|
||||
#############
|
||||
#
|
||||
# Networking
|
||||
#
|
||||
#############
|
||||
|
||||
#if "__DEFAULT_NETWORK__" in $interfaces
|
||||
#set idata = $interfaces["__DEFAULT_NETWORK__"]
|
||||
#set static = $idata['static']
|
||||
#set ip_address = $idata.get("ip_address", "127.0.0.1")
|
||||
#set netmask = $idata.get("netmask", "255.0.0.0")
|
||||
#set gateway = $getVar('gateway','127.0.0.1')
|
||||
#end if
|
||||
|
||||
d-i netcfg/choose_interface select __DEFAULT_NETWORK__
|
||||
d-i netcfg/dhcp_timeout string 60
|
||||
d-i netcfg/disable_autoconfig boolean true
|
||||
d-i netcfg/dhcp_failed note
|
||||
d-i netcfg/dhcp_options select Configure network manually
|
||||
|
||||
#if $static
|
||||
# Static network configuration.
|
||||
d-i netcfg/get_ipaddress string $idata.get("ip_address", "127.0.0.1")
|
||||
d-i netcfg/get_netmask string $idata.get("netmask", "255.0.0.0")
|
||||
d-i netcfg/get_gateway string $gateway
|
||||
d-i netcfg/get_nameservers string $name_servers[0]
|
||||
d-i netcfg/confirm_static boolean true
|
||||
#end if
|
||||
|
||||
d-i netcfg/get_hostname string $system_name
|
||||
d-i netcfg/get_domain string $hostname
|
||||
|
||||
# Disable that annoying WEP key dialog.
|
||||
d-i netcfg/wireless_wep string
|
||||
|
||||
#############
|
||||
#
|
||||
# Pre Install
|
||||
#
|
||||
#############
|
||||
|
||||
# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/__DEVICE_NAME__. See Ubuntu bug #1347726.
|
||||
d-i preseed/early_command string \
|
||||
umount /media || true
|
||||
|
||||
#############
|
||||
#
|
||||
# Net Image
|
||||
#
|
||||
#############
|
||||
|
||||
# Required at least for 12.10+
|
||||
d-i live-installer/net-image string http://$http_server/cobbler/links/$distro_name/install/filesystem.squashfs
|
||||
|
||||
#############
|
||||
#
|
||||
# Localization
|
||||
#
|
||||
#############
|
||||
|
||||
d-i debian-installer/locale string en
|
||||
d-i debian-installer/country string US
|
||||
d-i debian-installer/locale string en_US.UTF-8
|
||||
d-i debian-installer/language string en
|
||||
|
||||
#############
|
||||
#
|
||||
# Keyboard
|
||||
#
|
||||
#############
|
||||
|
||||
# Disable automatic (interactive) keymap detection.
|
||||
d-i console-setup/ask_detect boolean false
|
||||
d-i console-setup/layoutcode string us
|
||||
d-i console-setup/variantcode string
|
||||
d-i keyboard-configuration/layoutcode string us
|
||||
|
||||
#############
|
||||
#
|
||||
# Mirror
|
||||
#
|
||||
#############
|
||||
|
||||
d-i mirror/country string manual
|
||||
d-i mirror/http/proxy string
|
||||
d-i mirror/http/hostname string $http_server
|
||||
d-i mirror/http/directory string $install_source_directory
|
||||
|
||||
#############
|
||||
#
|
||||
# Clock and Time Zone
|
||||
#
|
||||
#############
|
||||
|
||||
# Controls whether to use NTP to set the clock during the install
|
||||
d-i clock-setup/ntp boolean true
|
||||
d-i clock-setup/ntp-server string ntp.ubuntu.com
|
||||
|
||||
# You may set this to any valid setting for $TZ; see the contents of
|
||||
# /usr/share/zoneinfo/ for valid values.
|
||||
d-i time/zone string US/Central
|
||||
|
||||
# Controls whether or not the hardware clock is set to UTC.
|
||||
d-i clock-setup/utc boolean true
|
||||
|
||||
#############
|
||||
#
|
||||
# Partitioning
|
||||
#
|
||||
#############
|
||||
|
||||
# If one of the disks that are going to be automatically partitioned
|
||||
# contains an old LVM configuration, the user will normally receive a
|
||||
# warning. This can be preseeded away...
|
||||
d-i partman-lvm/device_remove_lvm boolean true
|
||||
|
||||
# The same applies to pre-existing software RAID array:
|
||||
d-i partman-md/device_remove_md boolean true
|
||||
|
||||
# And the same goes for the confirmation to write the lvm partitions.
|
||||
d-i partman-lvm/confirm boolean true
|
||||
d-i partman-lvm/confirm_nooverwrite boolean true
|
||||
|
||||
d-i partman-auto/method string lvm
|
||||
d-i partman-auto/disk string /dev/__DEVICE_NAME__
|
||||
|
||||
# For LVM partitioning, you can select how much of the volume group to use
|
||||
# for logical volumes.
|
||||
d-i partman-auto-lvm/guided_size string max
|
||||
|
||||
# This is used to auto-confirm its OK to use a partition without an FS
|
||||
d-i partman-basicmethods/method_only boolean false
|
||||
|
||||
d-i partman-auto/choose_recipe select custompartitioning
|
||||
d-i partman-auto/expert_recipe string \
|
||||
custompartitioning :: \
|
||||
512 1 512 ext2 \
|
||||
$primary{ } \
|
||||
$bootable{ } \
|
||||
method{ format } format{ } \
|
||||
use_filesystem{ } filesystem{ ext2 } \
|
||||
label{ boot } \
|
||||
mountpoint{ /boot } \
|
||||
. \
|
||||
1024 1 100% ext4 \
|
||||
$primary{ } \
|
||||
method{ lvm } \
|
||||
device{ /dev/__DEVICE_NAME__2 } \
|
||||
vg_name{ lxc } \
|
||||
. \
|
||||
8192 1 8192 linux-swap \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ swap00 } \
|
||||
method{ swap } format{ } \
|
||||
. \
|
||||
51200 1 51200 ext4 \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ root00 } \
|
||||
method{ format } format{ } \
|
||||
use_filesystem{ } filesystem{ ext4 } \
|
||||
label{ root } \
|
||||
mountpoint{ / } \
|
||||
. \
|
||||
76800 1 76800 ext4 \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ openstack00 } \
|
||||
method{ format } format{ } \
|
||||
use_filesystem{ } filesystem{ ext4 } \
|
||||
label{ openstack00 } \
|
||||
mountpoint{ /openstack } \
|
||||
. \
|
||||
1024 1 1000000000 ext4 \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ cinder00 } \
|
||||
method{ keep } \
|
||||
. \
|
||||
|
||||
|
||||
# This makes partman automatically partition without confirmation, provided
|
||||
# that you told it what to do using one of the methods above.
|
||||
d-i partman-partitioning/confirm_write_new_label boolean true
|
||||
d-i partman/choose_partition select finish
|
||||
d-i partman/confirm boolean true
|
||||
d-i partman/confirm_nooverwrite boolean true
|
||||
|
||||
#############
|
||||
#
|
||||
# Packages
|
||||
#
|
||||
#############
|
||||
|
||||
# Package selection
|
||||
tasksel tasksel/first multiselect openssh-server
|
||||
|
||||
# Whether to upgrade packages after debootstrap.
|
||||
# Allowed values: none, safe-upgrade, full-upgrade
|
||||
d-i pkgsel/upgrade select none
|
||||
d-i pkgsel/include string bridge-utils ethtool ifenslave lvm2 openssh-server python2.7 vim vlan
|
||||
# Policy for applying updates. May be "none" (no automatic updates),
|
||||
# "unattended-upgrades" (install security updates automatically), or
|
||||
# "landscape" (manage system with Landscape).
|
||||
d-i pkgsel/update-policy select none
|
||||
|
||||
# Some versions of the installer can report back on what software you have
|
||||
# installed, and what software you use. The default is not to report back,
|
||||
# but sending reports helps the project determine what software is most
|
||||
# popular and include it on CDs.
|
||||
popularity-contest popularity-contest/participate boolean false
|
||||
|
||||
#############
|
||||
#
|
||||
# Users and Password
|
||||
#
|
||||
#############
|
||||
|
||||
# Skip creation of a root account (normal user account will be able to
|
||||
# use sudo). The default is false; preseed this to true if you want to set
|
||||
# a root password.
|
||||
d-i passwd/root-login boolean true
|
||||
|
||||
# Alternatively, to skip creation of a normal user account.
|
||||
d-i passwd/make-user boolean false
|
||||
|
||||
# The installer will warn about weak passwords. If you are sure you know
|
||||
# what you're doing and want to override it, uncomment this.
|
||||
d-i user-setup/allow-password-weak boolean true
|
||||
|
||||
# Root password, either in clear text
|
||||
d-i passwd/root-password password cobbler
|
||||
d-i passwd/root-password-again password cobbler
|
||||
|
||||
#############
|
||||
#
|
||||
# Bootloader
|
||||
#
|
||||
#############
|
||||
|
||||
# This is fairly safe to set, it makes grub install automatically to the MBR
|
||||
# if no other operating system is detected on the machine.
|
||||
d-i grub-installer/only_debian boolean true
|
||||
|
||||
#############
|
||||
#
|
||||
# Post Install
|
||||
#
|
||||
#############
|
||||
|
||||
d-i preseed/late_command string \
|
||||
wget http://$http_server/trusty-sources.list -O /target/etc/apt/sources.list; \
|
||||
wget http://$http_server/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
|
||||
wget http://$http_server/cblr/svc/op/nopxe/system/$system_name -O /dev/null; \
|
||||
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
|
||||
mkdir /target/root/.ssh; \
|
||||
chmod 0700 /target/root/.ssh; \
|
||||
echo "__SSHKEY__" >> /target/root/.ssh/authorized_keys; \
|
||||
vgcreate cinder-volumes /dev/mapper/lxc-cinder00; \
|
||||
killall.sh || true; \
|
||||
netcfg; \
|
||||
echo -e '#!/bin/sh\n\nif ! grep -q "^source.*cfg$" /etc/network/interfaces; then echo "source /etc/network/interfaces.d/*.cfg" >> /etc/network/interfaces; fi' > /target/etc/network/if-pre-up.d/multi-nic; \
|
||||
chmod +x /target/etc/network/if-pre-up.d/multi-nic
|
||||
|
||||
#############
|
||||
#
|
||||
# Finish
|
||||
#
|
||||
#############
|
||||
|
||||
# Reboot after the install is finished.
|
||||
finish-install finish-install/reboot_in_progress note
|
@ -0,0 +1,293 @@
|
||||
#
|
||||
# Ubuntu Server 16.04 Preseed
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# This Ubuntu Preseed file is meant to be used with Cobbler. It has been
|
||||
# tested only on Cobbler 2.4.1. It is a completely unattended install.
|
||||
#
|
||||
# References:
|
||||
#
|
||||
# https://help.ubuntu.com/16.04/installation-guide/example-preseed.txt
|
||||
# http://www.claudiokuenzler.com/blog/513/debian-ubuntu-preseed-create-two-volume-groups-same-disk
|
||||
|
||||
#############
|
||||
#
|
||||
# Kernel Options
|
||||
#
|
||||
#############
|
||||
|
||||
# Use the following option to add additional boot parameters for the
|
||||
# installed system (if supported by the bootloader installer).
|
||||
# Note: options passed to the installer will be added automatically.
|
||||
d-i debian-installer/add-kernel-opts string $kernel_options_post
|
||||
d-i debian-installer/add-kernel-opts string biosdevname=0 net.ifnames=0
|
||||
#############
|
||||
#
|
||||
# Networking
|
||||
#
|
||||
#############
|
||||
|
||||
#if "__DEFAULT_NETWORK__" in $interfaces
|
||||
#set idata = $interfaces["__DEFAULT_NETWORK__"]
|
||||
#set static = $idata['static']
|
||||
#set ip_address = $idata.get("ip_address", "127.0.0.1")
|
||||
#set netmask = $idata.get("netmask", "255.0.0.0")
|
||||
#set gateway = $getVar('gateway','127.0.0.1')
|
||||
#end if
|
||||
|
||||
d-i netcfg/choose_interface select __DEFAULT_NETWORK__
|
||||
d-i netcfg/dhcp_timeout string 60
|
||||
d-i netcfg/disable_autoconfig boolean true
|
||||
d-i netcfg/dhcp_failed note
|
||||
d-i netcfg/dhcp_options select Configure network manually
|
||||
|
||||
#if $static
|
||||
# Static network configuration.
|
||||
d-i netcfg/get_ipaddress string $idata.get("ip_address", "127.0.0.1")
|
||||
d-i netcfg/get_netmask string $idata.get("netmask", "255.0.0.0")
|
||||
d-i netcfg/get_gateway string $gateway
|
||||
d-i netcfg/get_nameservers string $name_servers[0]
|
||||
d-i netcfg/confirm_static boolean true
|
||||
#end if
|
||||
|
||||
d-i netcfg/get_hostname string $system_name
|
||||
d-i netcfg/get_domain string $hostname
|
||||
|
||||
# Disable that annoying WEP key dialog.
|
||||
d-i netcfg/wireless_wep string
|
||||
|
||||
#############
|
||||
#
|
||||
# Pre Install
|
||||
#
|
||||
#############
|
||||
|
||||
# Command Line 1: This is necessary otherwise you will be prompted to umount /dev/__DEVICE_NAME__. See Ubuntu bug #1347726.
|
||||
d-i preseed/early_command string \
|
||||
umount /media || true
|
||||
|
||||
#############
|
||||
#
|
||||
# Net Image
|
||||
#
|
||||
#############
|
||||
|
||||
# Required at least for 12.10+
|
||||
d-i live-installer/net-image string http://$http_server/cobbler/links/$distro_name/install/filesystem.squashfs
|
||||
|
||||
#############
|
||||
#
|
||||
# Localization
|
||||
#
|
||||
#############
|
||||
|
||||
d-i debian-installer/locale string en
|
||||
d-i debian-installer/country string US
|
||||
d-i debian-installer/locale string en_US.UTF-8
|
||||
d-i debian-installer/language string en
|
||||
|
||||
#############
|
||||
#
|
||||
# Keyboard
|
||||
#
|
||||
#############
|
||||
|
||||
# Disable automatic (interactive) keymap detection.
|
||||
d-i console-setup/ask_detect boolean false
|
||||
d-i console-setup/layoutcode string us
|
||||
d-i console-setup/variantcode string
|
||||
d-i keyboard-configuration/layoutcode string us
|
||||
|
||||
#############
|
||||
#
|
||||
# Mirror
|
||||
#
|
||||
#############
|
||||
|
||||
d-i mirror/country string manual
|
||||
d-i mirror/http/proxy string
|
||||
d-i mirror/http/hostname string $http_server
|
||||
d-i mirror/http/directory string $install_source_directory
|
||||
|
||||
#############
|
||||
#
|
||||
# Clock and Time Zone
|
||||
#
|
||||
#############
|
||||
|
||||
# Controls whether to use NTP to set the clock during the install
|
||||
d-i clock-setup/ntp boolean true
|
||||
d-i clock-setup/ntp-server string ntp.ubuntu.com
|
||||
|
||||
# You may set this to any valid setting for $TZ; see the contents of
|
||||
# /usr/share/zoneinfo/ for valid values.
|
||||
d-i time/zone string US/Central
|
||||
|
||||
# Controls whether or not the hardware clock is set to UTC.
|
||||
d-i clock-setup/utc boolean true
|
||||
|
||||
#############
|
||||
#
|
||||
# Partitioning
|
||||
#
|
||||
#############
|
||||
|
||||
# If one of the disks that are going to be automatically partitioned
|
||||
# contains an old LVM configuration, the user will normally receive a
|
||||
# warning. This can be preseeded away...
|
||||
d-i partman-lvm/device_remove_lvm boolean true
|
||||
|
||||
# The same applies to pre-existing software RAID array:
|
||||
d-i partman-md/device_remove_md boolean true
|
||||
|
||||
# And the same goes for the confirmation to write the lvm partitions.
|
||||
d-i partman-lvm/confirm boolean true
|
||||
d-i partman-lvm/confirm_nooverwrite boolean true
|
||||
|
||||
d-i partman-auto/method string lvm
|
||||
d-i partman-auto/disk string /dev/__DEVICE_NAME__
|
||||
|
||||
# For LVM partitioning, you can select how much of the volume group to use
|
||||
# for logical volumes.
|
||||
d-i partman-auto-lvm/guided_size string max
|
||||
|
||||
# This is used to auto-confirm its OK to use a partition without an FS
|
||||
d-i partman-basicmethods/method_only boolean false
|
||||
|
||||
d-i partman-auto/choose_recipe select custompartitioning
|
||||
d-i partman-auto/expert_recipe string \
|
||||
custompartitioning :: \
|
||||
512 1 512 ext2 \
|
||||
$primary{ } \
|
||||
$bootable{ } \
|
||||
method{ format } format{ } \
|
||||
use_filesystem{ } filesystem{ ext2 } \
|
||||
label{ boot } \
|
||||
mountpoint{ /boot } \
|
||||
. \
|
||||
1024 1 100% ext4 \
|
||||
$primary{ } \
|
||||
method{ lvm } \
|
||||
device{ /dev/__DEVICE_NAME__2 } \
|
||||
vg_name{ lxc } \
|
||||
. \
|
||||
8192 1 8192 linux-swap \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ swap00 } \
|
||||
method{ swap } format{ } \
|
||||
. \
|
||||
51200 1 51200 ext4 \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ root00 } \
|
||||
method{ format } format{ } \
|
||||
use_filesystem{ } filesystem{ ext4 } \
|
||||
label{ root } \
|
||||
mountpoint{ / } \
|
||||
. \
|
||||
76800 1 76800 ext4 \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ openstack00 } \
|
||||
method{ format } format{ } \
|
||||
use_filesystem{ } filesystem{ ext4 } \
|
||||
label{ openstack00 } \
|
||||
mountpoint{ /openstack } \
|
||||
. \
|
||||
1024 1 1000000000 ext4 \
|
||||
$lvmok{ } in_vg{ lxc } \
|
||||
lv_name{ cinder00 } \
|
||||
method{ keep } \
|
||||
. \
|
||||
|
||||
|
||||
# This makes partman automatically partition without confirmation, provided
|
||||
# that you told it what to do using one of the methods above.
|
||||
d-i partman-partitioning/confirm_write_new_label boolean true
|
||||
d-i partman/choose_partition select finish
|
||||
d-i partman/confirm boolean true
|
||||
d-i partman/confirm_nooverwrite boolean true
|
||||
|
||||
#############
|
||||
#
|
||||
# Packages
|
||||
#
|
||||
#############
|
||||
|
||||
# Package selection
|
||||
tasksel tasksel/first multiselect openssh-server
|
||||
|
||||
# Whether to upgrade packages after debootstrap.
|
||||
# Allowed values: none, safe-upgrade, full-upgrade
|
||||
d-i pkgsel/upgrade select none
|
||||
d-i pkgsel/include string bridge-utils ethtool ifenslave lvm2 openssh-server python vim vlan
|
||||
# Policy for applying updates. May be "none" (no automatic updates),
|
||||
# "unattended-upgrades" (install security updates automatically), or
|
||||
# "landscape" (manage system with Landscape).
|
||||
d-i pkgsel/update-policy select none
|
||||
|
||||
# Some versions of the installer can report back on what software you have
|
||||
# installed, and what software you use. The default is not to report back,
|
||||
# but sending reports helps the project determine what software is most
|
||||
# popular and include it on CDs.
|
||||
popularity-contest popularity-contest/participate boolean false
|
||||
|
||||
#############
|
||||
#
|
||||
# Users and Password
|
||||
#
|
||||
#############
|
||||
|
||||
# Skip creation of a root account (normal user account will be able to
|
||||
# use sudo). The default is false; preseed this to true if you want to set
|
||||
# a root password.
|
||||
d-i passwd/root-login boolean true
|
||||
|
||||
# Alternatively, to skip creation of a normal user account.
|
||||
d-i passwd/make-user boolean false
|
||||
|
||||
# The installer will warn about weak passwords. If you are sure you know
|
||||
# what you're doing and want to override it, uncomment this.
|
||||
d-i user-setup/allow-password-weak boolean true
|
||||
|
||||
# Root password, either in clear text
|
||||
d-i passwd/root-password password cobbler
|
||||
d-i passwd/root-password-again password cobbler
|
||||
|
||||
#############
|
||||
#
|
||||
# Bootloader
|
||||
#
|
||||
#############
|
||||
|
||||
# This is fairly safe to set, it makes grub install automatically to the MBR
|
||||
# if no other operating system is detected on the machine.
|
||||
d-i grub-installer/only_debian boolean true
|
||||
|
||||
#############
|
||||
#
|
||||
# Post Install
|
||||
#
|
||||
#############
|
||||
|
||||
d-i preseed/late_command string \
|
||||
wget http://$http_server/xenial-sources.list -O /target/etc/apt/sources.list; \
|
||||
wget http://$http_server/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
|
||||
wget http://$http_server/cblr/svc/op/nopxe/system/$system_name -O /dev/null; \
|
||||
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
|
||||
mkdir /target/root/.ssh; \
|
||||
chmod 0700 /target/root/.ssh; \
|
||||
echo "__SSHKEY__" >> /target/root/.ssh/authorized_keys; \
|
||||
vgcreate cinder-volumes /dev/mapper/lxc-cinder00; \
|
||||
killall.sh || true; \
|
||||
netcfg; \
|
||||
echo -e '#!/bin/sh\n\nif ! grep -q "^source.*cfg$" /etc/network/interfaces; then echo "source /etc/network/interfaces.d/*.cfg" >> /etc/network/interfaces; fi' > /target/etc/network/if-pre-up.d/multi-nic; \
|
||||
chmod +x /target/etc/network/if-pre-up.d/multi-nic
|
||||
|
||||
#############
|
||||
#
|
||||
# Finish
|
||||
#
|
||||
#############
|
||||
|
||||
# Reboot after the install is finished.
|
||||
finish-install finish-install/reboot_in_progress note
|
@ -0,0 +1,131 @@
|
||||
<domain type='kvm'>
|
||||
<name>__NODE__.openstackci.local</name>
|
||||
<memory unit='GiB'>1</memory>
|
||||
<currentMemory unit='GiB'>1</currentMemory>
|
||||
<vcpu placement='static'>1</vcpu>
|
||||
<resource>
|
||||
<partition>/machine</partition>
|
||||
</resource>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
</features>
|
||||
<cpu mode='host-model'>
|
||||
<model fallback='allow'/>
|
||||
</cpu>
|
||||
<clock offset='utc'>
|
||||
<timer name='rtc' tickpolicy='catchup'/>
|
||||
<timer name='pit' tickpolicy='delay'/>
|
||||
<timer name='hpet' present='no'/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<pm>
|
||||
<suspend-to-mem enabled='no'/>
|
||||
<suspend-to-disk enabled='no'/>
|
||||
</pm>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='qemu' type='qcow2' cache='none' io='native'/>
|
||||
<source file='/var/lib/libvirt/images/__NODE__.openstackci.local.img'/>
|
||||
<target dev='__DEVICE_NAME__' bus='virtio'/>
|
||||
<boot order='1'/>
|
||||
<alias name='virtio-disk0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||
</disk>
|
||||
<controller type='pci' index='0' model='pci-root'>
|
||||
<alias name='pci.0'/>
|
||||
</controller>
|
||||
<controller type='virtio-serial' index='0'>
|
||||
<alias name='virtio-serial0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
||||
</controller>
|
||||
<interface type='bridge'>
|
||||
<mac address="52:54:00:bd:81:__COUNT__"/>
|
||||
<source bridge='br-dhcp'/>
|
||||
<target dev='vnet0'/>
|
||||
<model type='virtio'/>
|
||||
<boot order='2'/>
|
||||
<alias name='net0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<mac address="52:54:00:fd:7f:__COUNT__"/>
|
||||
<source bridge='vm-br-eth1'/>
|
||||
<target dev='vnet1'/>
|
||||
<model type='virtio'/>
|
||||
<boot order='3'/>
|
||||
<alias name='net1'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<mac address="52:54:00:f5:44:__COUNT__"/>
|
||||
<source bridge='vm-br-eth2'/>
|
||||
<target dev='vnet2'/>
|
||||
<model type='virtio'/>
|
||||
<boot order='4'/>
|
||||
<alias name='net2'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<mac address="52:54:00:1f:96:__COUNT__"/>
|
||||
<source bridge='vm-br-eth3'/>
|
||||
<target dev='vnet3'/>
|
||||
<model type='virtio'/>
|
||||
<boot order='5'/>
|
||||
<alias name='net3'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<mac address="52:54:00:50:03:__COUNT__"/>
|
||||
<source bridge='vm-br-eth4'/>
|
||||
<target dev='vnet4'/>
|
||||
<model type='virtio'/>
|
||||
<boot order='6'/>
|
||||
<alias name='net4'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<mac address="52:54:00:2d:12:__COUNT__"/>
|
||||
<source bridge='vm-br-eth5'/>
|
||||
<target dev='vnet5'/>
|
||||
<model type='virtio'/>
|
||||
<boot order='7'/>
|
||||
<alias name='net5'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
|
||||
</interface>
|
||||
<serial type='pty'>
|
||||
<source path='/dev/pts/4'/>
|
||||
<target port='0'/>
|
||||
<alias name='serial0'/>
|
||||
</serial>
|
||||
<console type='pty' tty='/dev/pts/4'>
|
||||
<source path='/dev/pts/4'/>
|
||||
<target type='serial' port='0'/>
|
||||
<alias name='serial0'/>
|
||||
</console>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
</graphics>
|
||||
<video>
|
||||
<model type='vmvga' vram='1024' heads='1'/>
|
||||
<alias name='video0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
</video>
|
||||
<memballoon model='virtio'>
|
||||
<alias name='balloon0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||
</memballoon>
|
||||
<rng model='virtio'>
|
||||
<backend model='random'>/dev/random</backend>
|
||||
<alias name='rng0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
|
||||
</rng>
|
||||
</devices>
|
||||
</domain>
|
@ -42,3 +42,6 @@ PRE_CONFIG_OSA="${PRE_CONFIG_OSA:-true}"
|
||||
|
||||
# Should we run the final deploy of OpenStack-Ansible
|
||||
RUN_OSA="${RUN_OSA:-true}"
|
||||
|
||||
# Default service ports
|
||||
OSA_PORTS="${OSA_PORTS:-6080 6082 443 80}"
|
Loading…
Reference in New Issue
Block a user