Combine our two multi-node-aio processes into one

The original mnaio was built using a lot of bash and was tailored
specifically for ubuntu 14.04. The new mnaio was built using a mix of
bash and ansible and was tailored specifically for ubuntu 16.04. This
patch takes the two code bases and combines the best things from each
method and wraps it up into a single code path all written using ansible
playbooks and basic variables.

While underlying system has changed the bash environment variable syntax
for overrides remains the same. This allows users to continue with what
has become their normal work-flow while leveraging the new structure and
capabilities.

High level overview:
  * The general performance of the VMs running within the MNAIO will now
    be a lot better. Before the VMs were built within QCOW2 containers,
    while this was flexible and portable it was slower. The new
    capabilities will use RAW logical volumes and native IO.
  * New repo management starts with preseeds and allows the user to pin
    to specific repositories without having to worry about flipping them
    post build.
  * CPU overhead will be a lot less. The old VM system used an
    un-reasonable number of processors per VM which directly translated
    to sockets. The new system will use cores and a single socket
    allowing for generally better VM performance with a lot less
    overhead and resource contention on the host.
  * Memory consumption has been greatly reduced. Each VM is now
    following the memory restrictions we'd find in the gate, as a MAX.
    Most of the VMs are using 1 - 2 GiB of RAM which should be more than
    enough for our purposes.

Overall the deployment process is simpler and more flexible and will
work on both trusty and xenial out of the box with the hope to bring
centos7 and suse into the fold some time in the future.

Change-Id: Idc8924452c481b08fd3b9362efa32d10d1b8f707
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2017-07-27 00:58:32 -05:00 committed by weezer su
parent 56e888a375
commit a94f0a9026
150 changed files with 2689 additions and 12343 deletions

View File

@ -0,0 +1 @@
multi-node-aio

View File

@ -1,229 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Files in this project licensed under the MIT license:
- playbooks/plugins/callbacks/profile_tasks.py

View File

@ -1,15 +0,0 @@
OpenStack-Ansible Multi-Node AIO Xenial Ansible
################################################
:date: 2016-02-23
:tags: rackspace, openstack, ansible
:category: \*openstack, \*nix
About this repository
---------------------
This is a re-engineered version of the Multi-Node AIO Cobbler has been removed
and replaced with Ansible to do the deploy of the KVM virtual machines. With time the intent here is to
replace the bash which deploys this all with Ansible.
Trusty will not be supported.

View File

@ -1,49 +0,0 @@
#!/usr/bin/env bash
set -eu
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Provide defaults for unset variables
# Set first two octets of network used for containers, storage, etc
NETWORK_BASE=${NETWORK_BASE:-10.29}
# Instruct the system do all of the require host setup
SETUP_HOST=${SETUP_HOST:-true}
[[ "${SETUP_HOST}" = true ]] && source setup-host.sh
SETUP_PXEBOOT=${SETUP_PXEBOOT:-true}
[[ "${SETUP_PXEBOOT}" = true ]] && source setup-pxeboot.sh
# Instruct the system do all of the virsh setup
SETUP_VIRSH_NET=${SETUP_VIRSH_NET:-true}
[[ "${SETUP_VIRSH_NET}" = true ]] && source setup-virsh-net.sh
# Instruct the system to create and boot all of the VMs
CREATE_VMS=${CREATE_VMS:-true}
[[ "${CREATE_VMS}" = true ]] && source no-cobbler-create-vms.sh
# Instruct the system to configure all of the VMs
CONFIGURE_VMS=${CONFIGURE_VMS:-true}
[[ "${CONFIGURE_VMS}" = true ]] && source no-cobbler-configure-vms.sh
# Instruct the system to deploy OpenStack Ansible
DEPLOY_OSA=${DEPLOY_OSA:-true}
[[ "${DEPLOY_OSA}" = true ]] && source config-deploy-node.sh

View File

@ -1,31 +0,0 @@
#!/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
if [[ "${DEPLOY_OSA}" = true ]]; then
# 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"
fi
if [[ "${CONFIG_PREROUTING}" = true ]]; then
EXTERNAL_IP="$(ip route get 1 | awk '{print $NF;exit}')"
# Add 2222 rules to iptables for ssh directly into deployment node.
iptables_filter_rule_add nat "PREROUTING -p tcp -d ${EXTERNAL_IP} --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 -d ${EXTERNAL_IP} --dport ${port} -j DNAT --to 10.0.0.150:${port}"
done
fi

View File

@ -1,139 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# create_pxeboot_server.yml
#
# This playbook contains all the data to deploy a PXE server with TFTP/ Apache and the preseed
# environment for Ubuntu Xenial. This is to replace Cobbler.
- hosts: all
become: yes
become_method: sudo
vars:
proxy: "{{ lookup('env','http_proxy') }}"
# - List of DHCP Subnets
dhcp_list:
- netmask: 255.255.255.0
gateway: 10.0.0.200
dns: "{{ ansible_dns.nameservers.0 }}"
subnet: 10.0.0.0 # Subnet mask
default_lease_time: 21600 # Subnet Default lease time - The default is used if this is not defined
max_lease_time: 43200 # Subnet Max lease time - The default is used if this is not defined
tftp_boot_path: /pxelinux.0 # Path for tftp of where to boot from first - The default is used if this is not defined
tftp_server: 10.0.0.200 # The server hosting the TFTP server - The default is used if this is not defined
dhcp_default_domain_name: openstackci.local # The domain-name option - the above global default is used if this is not defined
# - tftpboot_configure
tftp_mirror: 10.0.0.200
tftp_proxy: "{{ proxy }}"
webserver_ip_address: 10.0.0.200
ntp_server: "{{ lookup('pipe','grep -m 1 pool /etc/ntp.conf').split(' ').1 }}" # Check in NTP directory, look for the first pool match and use as our NTP server
atftpd_path: /srv/tftp
tftp_source: /srv/tftp/pxelinux.cfg
atftp_user: atftp
atftp_group: atftp
distro_name: ubuntu-16.04.2-server-amd64.iso
distro_url : "http://releases.ubuntu.com/16.04/{{ distro_name }}"
# These below variables rely on apache being set up and is where the preseed is set up
apache_url: files
apache_path: /var/www/html
tftp_directories:
- pxe
- ubuntu
# - List of static DHCP hosts - These are iterated though and each will be created
# last byte of hwaddr matches last two digits of ip address
server_list:
- name: cinder1
hwaddr: "52:54:00:bd:81:30"
ip: "10.0.0.130"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-cinder.seed
- name: cinder2
hwaddr: "52:54:00:bd:81:31"
ip: "10.0.0.131"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-cinder.seed
- name: infra1
hwaddr: "52:54:00:bd:81:00"
ip: "10.0.0.100"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-infra.seed
- name: infra2
hwaddr: "52:54:00:bd:81:01"
ip: "10.0.0.101"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-infra.seed
- name: infra3
hwaddr: "52:54:00:bd:81:02"
ip: "10.0.0.102"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-infra.seed
- name: logging1
hwaddr: "52:54:00:bd:81:10"
ip: "10.0.0.110"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-logging.seed
- name: compute1
hwaddr: "52:54:00:bd:81:20"
ip: "10.0.0.120"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-nova_compute.seed
- name: compute2
hwaddr: "52:54:00:bd:81:21"
ip: "10.0.0.121"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-nova_compute.seed
- name: swift1
hwaddr: "52:54:00:bd:81:40"
ip: "10.0.0.140"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-swift.seed
- name: swift2
hwaddr: "52:54:00:bd:81:41"
ip: "10.0.0.141"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-swift.seed
- name: swift3
hwaddr: "52:54:00:bd:81:42"
ip: "10.0.0.142"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-swift.seed
- name: deploy1
hwaddr: "52:54:00:bd:81:50"
ip: "10.0.0.150"
distro: xenial
preseed_file: ubuntu-server-16.04-unattended-deploy.seed
roles:
- { role: proxy_install, when: proxy|length > 0 }
- { role: dhcpd_install }
- { role: atftpd_install }
- { role: apache_install }
- { role: tftpboot_configure }

View File

@ -1,150 +0,0 @@
#!/usr/bin/env bash
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
MAX_RETRIES=${MAX_RETRIES:-5}
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Provide defaults for unset variables
# Set first two octets of network used for containers, storage, etc
NETWORK_BASE=${NETWORK_BASE:-10.29}
# Reset the ssh-agent service to remove potential key issues
ssh_agent_reset
# Install git and tmux for use within the OSA deploy
apt-get install -y git tmux
# Clone the OSA source code
git clone https://git.openstack.org/openstack/openstack-ansible /opt/openstack-ansible || true
# Ensure the "/etc/openstack_deploy" exists
mkdir_check "/etc/openstack_deploy"
pushd /opt/openstack-ansible/
# Fetch all current refs
git fetch --all
# Checkout the OpenStack-Ansible branch
git checkout "${OSA_BRANCH:-master}"
# Copy the etc files into place
cp -vR etc/openstack_deploy/* /etc/openstack_deploy/
popd
# Create a secondary static inventory for hosts
ansible_static_inventory "/opt/ansible-static-inventory.ini"
# Create the OpenStack User Config
HOSTIP="$(ip route get 1 | awk '{print $NF;exit}')"
sed -e "s/__HOSTIP__/${HOSTIP}/g" -e "s/__NETWORK_BASE__/${NETWORK_BASE}/g" templates/openstack_user_config.yml > /etc/openstack_deploy/openstack_user_config.yml
# Create the swift config: function group_name host_type
cp -v templates/osa-swift.yml /etc/openstack_deploy/conf.d/swift.yml
### =========== WRITE OF conf.d FILES =========== ###
# Setup cinder hosts: function group_name host_type
write_osa_general_confd storage-infra_hosts cinder
write_osa_cinder_confd storage_hosts cinder
# Setup nova hosts: function group_name host_type
write_osa_general_confd compute_hosts nova_compute
# Setup infra hosts: function group_name host_type
write_osa_general_confd identity_hosts infra
write_osa_general_confd repo-infra_hosts infra
write_osa_general_confd os-infra_hosts infra
write_osa_general_confd shared-infra_hosts infra
# Setup logging hosts: function group_name host_type
write_osa_general_confd log_hosts logging
# Setup network hosts: function group_name host_type
write_osa_general_confd network_hosts infra
# Setup swift hosts: function group_name host_type
write_osa_swift_proxy_confd swift-proxy_hosts swift
write_osa_swift_storage_confd swift_hosts swift
### =========== END WRITE OF conf.d FILES =========== ###
# Enable pre-config the OSA enviroment for deploying OSA.
PRE_CONFIG_OSA=${PRE_CONFIG_OSA:-true}
if [[ "${PRE_CONFIG_OSA}" = true ]]; then
pushd /opt/openstack-ansible/
# Bootstrap ansible into the environment
bash ./scripts/bootstrap-ansible.sh
# Generate the passwords for the environment
python ./scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
# This is happening so the VMs running the infra use less storage
osa_user_var_add lxc_container_backing_store 'lxc_container_backing_store: dir'
# Tempest is being configured to use a known network
osa_user_var_add tempest_public_subnet_cidr 'tempest_public_subnet_cidr: '${NETWORK_BASE}'.248.0/26'
# This makes running neutron in a distributed system easier and a lot less noisy
osa_user_var_add neutron_l2_population 'neutron_l2_population: True'
# This makes the glance image store use swift instead of the file backend
osa_user_var_add glance_default_store 'glance_default_store: swift'
# Propagate host proxy settings (if set) into /etc/environment in the targets
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:'
osa_user_var_add ' HTTP_PROXY:' ' HTTP_PROXY: "{{ proxy_env_url }}"'
osa_user_var_add ' HTTPS_PROXY:' ' HTTPS_PROXY: "{{ proxy_env_url }}"'
osa_user_var_add ' NO_PROXY:' ' NO_PROXY: "{{ no_proxy_env }}"'
osa_user_var_add ' http_proxy:' ' http_proxy: "{{ proxy_env_url }}"'
osa_user_var_add ' https_proxy:' ' https_proxy: "{{ proxy_env_url }}"'
osa_user_var_add ' no_proxy:' ' no_proxy: "{{ no_proxy_env }}"'
# Propagate proxy setting to glance api conf. Note the unusual format - instead of the typical
# http_proxy=http://proxy.example.com ; https_proxy=http://proxy.example.com
# it uses
# http:proxy.example.com, https:proxy.example.com
#
osa_user_var_add glance_glance_api_conf_overrides 'glance_glance_api_conf_overrides:'
osa_user_var_add ' glance_store' ' glance_store:'
osa_user_var_add ' http_proxy_information' " http_proxy_information: \"http:${http_proxy#http://}, https:${http_proxy#http://}\""
fi
popd
fi
# Enable deploy OSA of the "${RUN_OSA}"
RUN_OSA=${RUN_OSA:-true}
if [[ "${RUN_OSA}" = true ]]; then
# Set the number of forks for the ansible client calls
export ANSIBLE_FORKS=${ANSIBLE_FORKS:-15}
pushd /opt/openstack-ansible
export DEPLOY_AIO=true
bash ./scripts/run-playbooks.sh
popd
EXEC_DIR="$(pwd)"
pushd /opt/openstack-ansible/playbooks
if [[ -f "/usr/local/bin/openstack-ansible.rc" ]]; then
source /usr/local/bin/openstack-ansible.rc
fi
ansible -m script -a "${EXEC_DIR}/openstack-service-setup.sh ${NETWORK_BASE}" 'utility_all[0]'
popd
fi

View File

@ -1,257 +0,0 @@
#!/usr/bin/env bash
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function mkdir_check {
if [ ! -d "$1" ];then
mkdir -p "$1"
fi
}
function ssh_agent_reset {
# If you were running ssh-agent with forwarding this will clear out the keys
# in your cache which can cause confusion.
if pgrep ssh-agent; then
killall ssh-agent; eval `ssh-agent`
fi
}
function iptables_general_rule_add {
if ! iptables -w -C $1;then
iptables -w -I $1
fi
}
function iptables_filter_rule_add {
if ! iptables -w -t $1 -C $2;then
iptables -w -t $1 -I $2
fi
}
function get_host_type {
python <<EOL
import json
with open('hosts.json') as f:
x = json.loads(f.read())
for k, v in x.get("$1").items():
print('%s:%s' % (k, v))
EOL
}
function get_all_hosts {
python <<EOL
import json
with open('hosts.json') as f:
x = json.loads(f.read())
for i in x.values():
for k, v in i.items():
print('%s:%s' % (k, v))
EOL
}
function get_all_types {
python <<EOL
import json
with open('hosts.json') as f:
x = json.loads(f.read())
for i in x.keys():
print(i)
EOL
}
function wait_ssh {
echo "Waiting for all nodes to become available. This can take around ${1:-10} min"
for node in $(get_all_hosts); do
echo "Waiting for node: ${node%%":"*} on 10.0.0.${node#*":"}"
until ssh -q -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=10 10.0.0.${node#*':'} exit > /dev/null; do
sleep 15
done
done
}
function rekick_vms {
# If you pass the short name of the host to the function it will only force rekick just the ONE host.
# Set the VM disk size in gigabytes
VM_DISK_SIZE="${VM_DISK_SIZE:-252}"
for node in ${1:-$(get_all_hosts)}; do
for node_name in $(virsh list --all --name | grep "${node%%":"*}"); do
virsh destroy "${node_name}" || true
done
# Instruct the system to run the image create.
# If you have the option ``VM_IMAGE_CREATE=true`` the system will reformat the disk image
# destroying anything that was it image previously.
VM_IMAGE_CREATE=${VM_IMAGE_CREATE:-true}
if [[ "${VM_IMAGE_CREATE}" = true ]]; then
qemu-img create -f qcow2 \
-o preallocation=metadata,compat=1.1,lazy_refcounts=on \
/var/lib/libvirt/images/${node%%":"*}.openstackci.local.img \
"${VM_DISK_SIZE}G"
fi
VM_NAME=$(virsh list --all --name | grep "${node%%":"*}" || echo "")
if [[ -z "${VM_NAME}" ]]; then
virsh define /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml || true
virsh create /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml || true
else
virsh start "${VM_NAME}"
fi
done
}
function write_osa_general_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
done
}
function write_osa_cinder_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
cat >> ${CONFD_FILE} <<EOF
container_vars:
cinder_backends:
limit_container_types: cinder_volume
lvm:
volume_group: cinder-volumes
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI
iscsi_ip_address: "${NETWORK_BASE}.236.${node#*":"}"
EOF
done
}
function write_osa_swift_proxy_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
cat >> ${CONFD_FILE} <<EOF
container_vars:
swift_proxy_vars:
limit_container_types: swift_proxy
read_affinity: "r1=100"
write_affinity: "r1"
write_affinity_node_count: "1 * replicas"
EOF
done
}
function write_osa_swift_storage_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
cat >> ${CONFD_FILE} <<EOF
container_vars:
swift_vars:
limit_container_types: swift
zone: 0
region: 1
EOF
done
}
function osa_user_var_add {
if ! grep -q "^$1" /etc/openstack_deploy/user_variables.yml; then
echo "$2" | tee -a /etc/openstack_deploy/user_variables.yml
else
sed -i "s|$1.*|$2|g" /etc/openstack_deploy/user_variables.yml
fi
}
function ansible_static_inventory {
CONFD_FILE="$1"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
for node_type in $(get_all_types); do
echo "[${node_type}]" >> ${CONFD_FILE}
for node in $(get_host_type ${node_type}); do
echo "10.0.0.${node#*":"}" >> ${CONFD_FILE}
done
done
}
function install_bits {
successerator openstack-ansible $@
}
function successerator {
set +e
# Get the time taht the method was started
OP_START_TIME=$(date +%s)
#Set the initial return value to failure.
false
for ((RETRY=0; $? != 0 && RETRY < MAX_RETRIES; RETRY++)); do
if [ ${RETRY} -gt 1 ]; then
$@ -vvvv
else
$@
fi
done
# If max retries were hit, fail.
if [ $? -ne 0 && [ ${RETRY} -eq ${MAX_RETRIES} ];then
echo -e "\n Hit maximum number of retries, giving up..\n"
exit
fi
# Print the time that the method completed.
OP_TOTAL_SECONDS="$(( $(date +%s) - OP_START_TIME ))"
REPORT_OUTPUT="${OP_TOTAL_SECONDS} seconds"
REPORT_DATA+="- Operation: [ $@ ]\t${REPORT_OUTPUT}\tNumber of Attempts [ ${RETRY} ]\n"
echo -e "Run Time = ${REPORT_OUTPUT}"
set -e
}
# Return 1 if the second argument is a substring of the first argument, otherwise return 0
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" == "$string"
then
echo 0 # $substring is not in $string
else
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())
haproxy_services = (x.get('haproxy_default_services')
or x.get('haproxy_service_configs'))
for i in haproxy_services:
y = i['service'].get('haproxy_port')
if isinstance(y, int):
print y
EOL
}

View File

@ -1,26 +0,0 @@
{
"infra": {
"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"
},
"deploy": {
"deploy1":"150"
}
}

View File

@ -1,2 +0,0 @@
[all]
localhost ansible_connection=local

View File

@ -1,81 +0,0 @@
#!/usr/bin/env bash
set -eu
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Reset the ssh-agent service to remove potential key issues
ssh_agent_reset
# Wait here for all nodes to be booted and ready with SSH
wait_ssh
# Export all system keys
mkdir -p /tmp/keys
for i in $(apt-key list | awk '/pub/ {print $2}' | awk -F'/' '{print $2}'); do
apt-key export "$i" > "/tmp/keys/$i"
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
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"
fi
done
ssh -q -n -f -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

View File

@ -1,50 +0,0 @@
#!/usr/bin/env bash
set -eu
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Reset the ssh-agent service to remove potential key issues
ssh_agent_reset
# Set the default preseed device name.
# This is being set because sda is on hosts, vda is kvm, xvda is xen.
DEVICE_NAME="${DEVICE_NAME:-vda}"
# Set Ethernet type
ETH_TYPE="${ETH_TYPE:-eth}"
# Create VM Basic Configuration files
for node_type in $(get_all_types); do
for node in $(get_host_type ${node_type}); do
cp -v "templates/vmnode-config/${node_type}.openstackci.local.xml" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
sed -i "s|__NODE__|${node%%":"*}|g" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
sed -i "s|__COUNT__|${node:(-2)}|g" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
sed -i "s|__DEVICE_NAME__|${DEVICE_NAME}|g" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
sed -i "s|__CONTAINER_VMS__|${CONTAINER_VMS}|g" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
done
done
# Populate network configurations based on node type
for node_type in $(get_all_types); do
for node in $(get_host_type ${node_type}); do
sed -e "s/__COUNT__/${node#*":"}/g" -e "s/__DEFAULT_NETWORK__/${DEFAULT_NETWORK}/g" -e "s/__NETWORK_BASE__/${NETWORK_BASE}/g" -e "s/__ETH_TYPE__/${ETH_TYPE}/g" "templates/network-interfaces/vm.openstackci.local-bonded-bridges.cfg" > "/var/www/html/osa-${node%%":"*}-bridges.cfg"
done
done
# Kick all of the VMs to run the cloud
# !!!THIS TASK WILL DESTROY ALL OF THE ROOT DISKS IF THEY ALREADY EXIST!!!
rekick_vms

View File

@ -1,175 +0,0 @@
#!/usr/bin/env bash
# Load service variables
source openrc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Provide defaults for unset variables
# Set first two octets of network used for containers, storage, etc
NETWORK_BASE=${NETWORK_BASE:-10.29}
# Create base flavors for the new deployment
for flavor in micro tiny mini small medium large xlarge heavy; do
NAME="m1.${flavor}"
ID="${ID:-0}"
RAM="${RAM:-256}"
DISK="${DISK:-1}"
VCPU="${VCPU:-1}"
SWAP="${SWAP:-0}"
EPHEMERAL="${EPHEMERAL:-0}"
nova flavor-delete $ID > /dev/null || echo "No Flavor with ID: [ $ID ] found to clean up"
nova flavor-create $NAME $ID $RAM $DISK $VCPU --swap $SWAP --is-public true --ephemeral $EPHEMERAL --rxtx-factor 1
let ID=ID+1
let RAM=RAM*2
if [ "$ID" -gt 5 ];then
let VCPU=VCPU*2
let DISK=DISK*2
let EPHEMERAL=256
let SWAP=4
elif [ "$ID" -gt 4 ];then
let VCPU=VCPU*2
let DISK=DISK*4+$DISK
let EPHEMERAL=$DISK/2
let SWAP=4
elif [ "$ID" -gt 3 ];then
let VCPU=VCPU*2
let DISK=DISK*4+$DISK
let EPHEMERAL=$DISK/3
let SWAP=4
elif [ "$ID" -gt 2 ];then
let VCPU=VCPU+$VCPU/2
let DISK=DISK*4
let EPHEMERAL=$DISK/3
let SWAP=4
elif [ "$ID" -gt 1 ];then
let VCPU=VCPU+1
let DISK=DISK*2+$DISK
fi
done
# Neutron provider network setup
neutron net-create GATEWAY_NET \
--router:external=True \
--provider:physical_network=flat \
--provider:network_type=flat
neutron subnet-create GATEWAY_NET ${NETWORK_BASE}.248.0/22 \
--name GATEWAY_NET_SUBNET \
--gateway ${NETWORK_BASE}.248.1 \
--allocation-pool start=${NETWORK_BASE}.248.201,end=${NETWORK_BASE}.248.255 \
--dns-nameservers list=true ${DNS_NAMESERVER}
# Neutron private network setup
neutron net-create PRIVATE_NET \
--shared \
--router:external=True \
--provider:network_type=vxlan \
--provider:segmentation_id 101
neutron subnet-create PRIVATE_NET 192.168.0.0/24 \
--name PRIVATE_NET_SUBNET
# Neutron router setup
ROUTER_ID=$(neutron router-create GATEWAY_NET_ROUTER | grep -w id | awk '{print $4}')
neutron router-gateway-set \
${ROUTER_ID} \
$(neutron net-list | awk '/GATEWAY_NET/ {print $2}')
neutron router-interface-add \
${ROUTER_ID} \
$(neutron subnet-list | awk '/PRIVATE_NET_SUBNET/ {print $2}')
# Neutron security group setup
for id in $(neutron security-group-list -f yaml | awk '/- id\:/ {print $3}'); do
# Allow ICMP
neutron security-group-rule-create --protocol icmp \
--direction ingress \
$id || true
# Allow all TCP
neutron security-group-rule-create --protocol tcp \
--port-range-min 1 \
--port-range-max 65535 \
--direction ingress \
$id || true
# Allow all UDP
neutron security-group-rule-create --protocol udp \
--port-range-min 1 \
--port-range-max 65535 -\
-direction ingress \
$id || true
done
# Create some default images
wget http://uec-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
glance image-create --name 'Ubuntu 14.04 LTS' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file ubuntu-14.04-server-cloudimg-amd64-disk1.img
rm ubuntu-14.04-server-cloudimg-amd64-disk1.img
wget http://uec-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
glance image-create --name 'Ubuntu 16.04' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file ubuntu-16.04-server-cloudimg-amd64-disk1.img
rm ubuntu-16.04-server-cloudimg-amd64-disk1.img
wget http://dfw.mirror.rackspace.com/fedora/releases/24/CloudImages/x86_64/images/Fedora-Cloud-Base-24-1.2.x86_64.qcow2
glance image-create --name 'Fedora 24' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file Fedora-Cloud-Base-24-1.2.x86_64.qcow2
rm Fedora-Cloud-Base-24-1.2.x86_64.qcow2
wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
glance image-create --name 'CentOS 7' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file CentOS-7-x86_64-GenericCloud.qcow2
rm CentOS-7-x86_64-GenericCloud.qcow2
wget http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64-0.0.4-Build2.12.qcow2
glance image-create --name 'OpenSuse Leap 42' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file openSUSE-Leap-42.1-OpenStack.x86_64-0.0.4-Build2.12.qcow2
rm openSUSE-Leap-42.1-OpenStack.x86_64-0.0.4-Build2.12.qcow2
wget http://cdimage.debian.org/cdimage/openstack/current/debian-8.6.0-openstack-amd64.qcow2
glance image-create --name 'Debian 8.6.0' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file debian-8.6.0-openstack-amd64.qcow2
rm debian-8.6.0-openstack-amd64.qcow2
wget http://cdimage.debian.org/cdimage/openstack/testing/debian-testing-openstack-amd64.qcow2
glance image-create --name "Debian TESTING $(date +%m-%d-%y)" \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file debian-testing-openstack-amd64.qcow2
rm debian-testing-openstack-amd64.qcow2
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
glance image-create --name "Cirros-0.3.4" \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file cirros-0.3.4-x86_64-disk.img
rm cirros-0.3.4-x86_64-disk.img

View File

@ -1,23 +0,0 @@
apache_install
=========
This module installs Apache2 and configures a site
Requirements
------------
This module requires Ansible 2.0+
Role Variables
--------------
See defaults for variables and descriptions
Example Playbook
----------------
Example to call:
- hosts: all
roles:
- { role: url: default }

View File

@ -1,26 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: apache_install/defaults
# description: ALL our default variables for apache_install go in here
#------------------------------------------------------------------------------
# Packages - All our required packages we need installing
#------------------------------------------------------------------------------
# - pre-requisites -
packages: # Packages required for apache role to work
- apache2
# - variables -
apache_url: blank # Default sub folder
publish_root: blank # What will the default path be for the apache site

View File

@ -1,20 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: apache_install/handlers
# description: All our handlers for apache_install go in here
- name: restart_apache2
service:
name: apache2
state: restarted

View File

@ -1,22 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
galaxy_info:
author: "Stuart Grace - BBC R&D"
license: Apache2
min_ansible_version: 2.0
platforms:
- name: Ubuntu
versions:
- xenial
dependencies: []

View File

@ -1,40 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: apache_install/tasks/configure
# description: Configure apache_install
- name: Create default index to show host info
copy:
content: "System - {{ ansible_fqdn }}"
dest: /var/www/html/index.html
- name: Create control file for apache site
template:
src: sites-allowed.j2
dest: "/etc/apache2/sites-available/{{ apache_url }}.conf"
mode: 0644
notify: restart_apache2
- name: Create publish root path
file:
path: "{{ apache_path }}"
state: directory
recurse: yes
- name: Enable apache site using symlink
file:
path: "/etc/apache2/sites-enabled/{{ apache_url }}.conf"
src: "/etc/apache2/sites-available/{{ apache_url }}.conf"
state: link
notify: restart_apache2

View File

@ -1,25 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: apache_install/tasks/install
# description: Install our required packages for apache_install
- name: Install all required packages for apache_install
apt:
pkg: "{{ packages }}"
state: latest
- name: Make sure Apache2 is enabled
service:
name: apache2
enabled: yes

View File

@ -1,18 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: apache_install/tasks
# description: Install apache onto an Ubuntu 16.xx server
- include: install.yml
- include: configure.yml

View File

@ -1,7 +0,0 @@
### MANAGED BY {{ role_path|basename }} ANSIBLE ROLE ###
Alias /{{apache_url}} {{apache_path}}
<Directory {{ apache_path }}>
Require all granted
Options +Indexes
</Directory>

View File

@ -1,23 +0,0 @@
atftpd_install
=========
This module installs atftpd and allows you to set the path of where it reads tftp from
Requirements
------------
This module requires Ansible 2.0
Role Variables
--------------
See defaults for variables and descriptions
Example Playbook
----------------
Example to call:
- hosts: all
roles:
- { role: atftpd_install, atftpd_path: /tftpboot }

View File

@ -1,26 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: atftpd_install/defaults
# description: ALL our default variables for atftpd_install go in here
#------------------------------------------------------------------------------
# Packages - All our required packages we need installing
#------------------------------------------------------------------------------
packages:
- atftpd
# - variables
atftpd_path: /srv/tftp # Where is our defined atftp path
atftp_user: nobody # What user does ATFTPd run as
atftp_group: nogroup # What group does ATFTPd run as

View File

@ -1,20 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: atftpd_install/handlers
# description: All our handlers for atftpd_install go in here
- name: atftpd_restart
service:
name: atftpd
state: restarted

View File

@ -1,22 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
galaxy_info:
author: "Rick Box - BBC R&D"
license: Apache2
min_ansible_version: 2.0
platforms:
- name: Ubuntu
versions:
- xenial
dependencies: []

View File

@ -1,39 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: atftpd_install/tasks/configure
# description: Configure atftpd_install
- name: Create group for application to run under
group:
name: "{{ atftp_group }}"
state: present
- name: Create user for application to run under
user:
name: "{{ atftp_user }}"
group: "{{ atftp_group }}"
state: present
- name: Atftp create directory and set permissions
file:
path: "{{ atftpd_path }}"
state: directory
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
- name: Atftpd set /etc/init.d/atftpd to not use xinetd and set our tftp path
template:
src: atftpd.j2
dest: /etc/default/atftpd
notify: atftpd_restart

View File

@ -1,25 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: atftpd_install/tasks/install
# description: Install our required packages for atftpd_install
- name: Install all required packages for atftpd_install
apt:
pkg: atftpd
state: latest
- name: Enable Atftpd on boot
service:
name: atftpd
enabled: yes

View File

@ -1,18 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: atftpd_install/tasks
# description: Install atftpd_install onto an Ubuntu 16.xx server
- include: install.yml
- include: configure.yml

View File

@ -1,3 +0,0 @@
### MANAGED BY {{ role_path|basename }} ANSIBLE ROLE ###
USE_INETD=false
OPTIONS="--user {{ atftp_user }}.{{ atftp_group }} --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 {{ atftpd_path }}"

View File

@ -1,23 +0,0 @@
dhcpd_install
=========
This module installs dhcpd
Requirements
------------
This module requires Ansible 2.x
Role Variables
--------------
See defaults for variables and descriptions
Example Playbook
----------------
Example to call:
- hosts: all
roles:
- { role: dhcpd_install }

View File

@ -1,45 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: dhcpd_install/defaults
# description: ALL our default variables for dhcpd_install go in here
#------------------------------------------------------------------------------
# Packages - All our required packages we need installing
#------------------------------------------------------------------------------
# - pre-requisites -
packages: # Packages required for dhcpd
- isc-dhcp-server
# - general variables -
dhcp_default_lease_time: 21600 # Default lease time
dhcp_max_lease_time: 43200 # Max lease time
tftp_server: 10.0.2.100 # The server hosting the TFTP server
tftp_boot_path: /pxelinux.0 # Path of where to boot from first
# - List of DHCP Subnets - These are iterated though and each will be created
dhcp_list:
- netmask: 255.255.255.0 # Netmask
gateway: 10.0.2.1 # Gateway
dns: 8.8.8.8 # DNS
subnet: 10.0.2.0 # Subnet mask
default_lease_time: 21600 # Subnet Default lease time - The default is used if this is not defined
max_lease_time: 43200 # Subnet Max lease time - The default is used if this is not defined
tftp_boot_path: /pxelinux.0 # Path for tftp of where to boot from first - The default is used if this is not defined
tftp_server: 10.0.2.100 # The server hosting the TFTP server - The default is used if this is not defined
# - List of static DHCP hosts - These are iterated though and each will be created
server_list:
- name: host # Server hostname
hwaddr: "aa:aa:aa:aa:aa:aa" # Server MAC
ip: "10.0.2.2" # Server IP

View File

@ -1,21 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: dhcpd_install/handlers
# description: All our handlers for dhcpd_install go in here
- name: restart dhcpd
service:
name: "{{ item }}"
state: restarted
with_items: "{{ packages }}"

View File

@ -1,22 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
galaxy_info:
author: "Rick Box - BBC R&D"
license: Apache2
min_ansible_version: 2.0
platforms:
- name: Ubuntu
versions:
- xenial
dependencies: []

View File

@ -1,24 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: dhcpd_install/tasks/configure
# description: Configure dhcpd_install
- name: Create a template in /etc/dhcp/dhcpd.conf
template:
src: dhcpd.conf.j2
dest: /etc/dhcp/dhcpd.conf
mode: 0644
owner: root
group: root
notify: restart dhcpd

View File

@ -1,26 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: dhcpd_install/tasks/install
# description: Install our required packages for dhcpd_install
- name: Install all required packages for dhcpd_install
apt:
pkg: "{{ packages }}"
state: latest
- name: Make sure -{{ packages }}- are enabled
service:
name: "{{ item }}"
enabled: yes
with_items: "{{ packages }}"

View File

@ -1,18 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: dhcpd_install/tasks
# description: Install dhcpd_install onto an Ubuntu 16.xx server
- include: install.yml
- include: configure.yml

View File

@ -1,28 +0,0 @@
proxy_install
=========
This module sets up a web and apt proxy on Ubuntu 16
Requirements
------------
This module requires Ansible 2.x
Role Variables
--------------
See defaults for variables and descriptions
Dependencies
------------
This role has no dependencies
Example Playbook
----------------
Example to call:
- hosts: all
roles:
- { role: proxy_install }

View File

@ -1,23 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: proxy_install/defaults
# description: ALL our default variables for proxy_install go in here
#------------------------------------------------------------------------------
# Packages - All our required packages we need installing
#------------------------------------------------------------------------------
# - Proxy URL -
proxy: http://proxy.example.com:8080 # Example proxy URL
environment_path: /etc/environment # Default path for environment
apt_proxy_path: /etc/apt/apt.conf.d/80proxy # Default path for apt proxy

View File

@ -1,22 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
galaxy_info:
author: "Rick Box - BBC R&D"
license: Apache2
min_ansible_version: 2.0
platforms:
- name: Ubuntu
versions:
- xenial
dependencies: []

View File

@ -1,37 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: proxy_install/tasks/configure
# description: Configure proxy_install
- name: Setup http proxy for APT
template:
src: 80proxy.j2
dest: "{{ apt_proxy_path }}"
mode: 0644
owner: root
group: root
- name: Setup http proxy environment variables
lineinfile:
dest: "{{ environment_path }}"
line: "{{ item.line }}"
regexp: "{{ item.regexp }}"
with_items:
- { line: "http_proxy={{ proxy }}", regexp: "^http_proxy=" }
- { line: "https_proxy={{ proxy }}", regexp: "^https_proxy=" }
- { line: "RSYNC_PROXY={{ proxy }}", regexp: "^RSYNC_PROXY=" }
- name: Change current environment variables, change disabled since it runs each time
shell: "export http_proxy={{ proxy }}; export https_proxy={{ proxy }}; export RSYNC_PROXY={{ proxy }}"
changed_when: false

View File

@ -1,17 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: proxy_install/tasks
# description: Install proxy_install onto an Ubuntu 16.xx server
- include: configure.yml

View File

@ -1,2 +0,0 @@
### MANAGED BY {{ role_path|basename }} ANSIBLE ROLE ###
Acquire::http::Proxy "{{ proxy }}";

View File

@ -1,28 +0,0 @@
tftpboot_configure
=========
This module configures custom tftp allowing for netboot of an Ubuntu system. It dynamically creates a TFTBoot based on the MAC addresses passed in. It also generates a preseed and late command which are used to install the system
Requirements
------------
This module requires Ansible 2.x
Role Variables
--------------
See defaults for variables and descriptions
Dependencies
------------
This role depends on a DHCPD and ATFTP roles
Example Playbook
----------------
Example to call:
- hosts: all
roles:
- { role: tftpboot_configure }

View File

@ -1,49 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# name: tftpboot_configure/defaults
# description: ALL our default variables for tftpboot_configure go in here
#------------------------------------------------------------------------------
# Packages - All our required packages we need installing
#------------------------------------------------------------------------------
# - variables -
tftp_mirror: archive.ubuntu.com # Where will we pull our linux boot environment from
tftp_proxy: blank # What proxy will we use, if any.
tftp_distro: [ xenial ] # What distribution will we pull
tftp_files: [ initrd.gz, linux ]
ntp_server: pool.ntp.org
atftpd_path: /srv/tftp # What is the path for our tftpd
tftp_source: /srv/tftp_source/ # What is the path where the source pxe config files are placed per server
atftp_user: nobody # What user does this environment get set up as
atftp_group: nogroup # What group does this environment get set up as
preseed_password: hackme # Default password placed into pre-seed file
vm_disk_device: vda # Default disk device used in pre-seed
vm_net_iface: eth0 # Default interface used in pre-seed
ssh_key: blank
distro_url:
# These below variables rely on apache being set up and is where the preseed is set up
preseed_apache_url: pxe # What is the url http://server/THISVARHERE
preseed_path: /var/www/html/pxe # What path
webserver_ip_address: "{{ ansible_default_ipv4.address }}"
server_list: # What is our list of servers
- name: blank
hwaddr: "aa:aa:aa:aa:aa:aa"
distro: xenial
preseed_file: my-preseed-file # Allow a custom preseed on a per server basis

View File

@ -1,22 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
galaxy_info:
author: "Rick Box - BBC R&D"
license: Apache2
min_ansible_version: 2.0
platforms:
- name: Ubuntu
versions:
- xenial
dependencies: []

View File

@ -1,118 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: tftpboot_configure/tasks/configure
# description: Configure tftpboot_configure
- name: Create pxeboot directories
file:
path: "{{ atftpd_path }}/{{ item }}"
state: directory
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
with_items:
- images
- pxelinux.cfg
- name: Create directories for distributions
file:
path: "{{ atftpd_path }}/images/{{ item }}/"
state: directory
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
with_items: "{{ tftp_distro }}"
- name: Create apache directories for preseed, ubuntu image,
file:
path: "{{ apache_path }}/{{ item }}"
state: directory
with_items: "{{ tftp_directories }}"
- name: Create the preseed files
template:
src: "{{ item.preseed_file }}.j2"
dest: "{{ preseed_path }}/{{ item.preseed_file }}"
with_items: "{{ server_list }}"
- name: Get ubuntu server image
get_url:
url: "{{ distro_url }}"
dest: "{{ atftpd_path }}/images/{{ distro_name }}"
mode: 0644
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
- name: mount the ubuntu image
mount:
name: "{{ apache_path }}/ubuntu/"
src: "{{ atftpd_path }}/images/{{ distro_name }}"
fstype: iso9660
opts: loop
state: mounted
- name: Pull down boot kernel and initrd - create download directory -{{ tftp_distro }}-
file:
path: "/var/lib/netboot/{{ item }}"
mode: 0644
state: directory
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
with_items: "{{ tftp_distro }}"
- name: Pull down boot kernel and initrd - download -"{{ tftp_distro }}"- releases -"{{ tftp_files }}"- files and place in /var/lib/netboot/
get_url:
url: "http://{{ tftp_mirror }}/ubuntu/install/netboot/ubuntu-installer/amd64/{{ item[1] }}"
dest: /var/lib/netboot/{{ item[0] }}
mode: 0644
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
with_nested:
- "{{ tftp_distro }}"
- "{{ tftp_files }}"
- name: Create hard link to our boot images in the distribution folder
file:
src: "/var/lib/netboot/{{ item[0] }}/{{ item[1] }}"
dest: "{{ atftpd_path }}/images/{{ item[0] }}/{{ item[1] }}"
state: hard
with_nested:
- "{{ tftp_distro }}"
- "{{ tftp_files }}"
- name: Copy pxe boot files
copy:
src: "{{ item }}"
dest: "{{ atftpd_path }}"
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
with_items:
- memdisk
- menu.c32
- pxelinux.0
- name: Create a template for each of our defined servers
template:
src: pxelinux.j2
dest: "{{ tftp_source }}/01-{{ item.hwaddr | regex_replace(':', '-') }}"
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"
follow: yes
with_items: "{{ server_list }}"
when: item.distro is defined
- name: Create our default template for menu
template:
src: default_pxelinux.j2
dest: "{{ atftpd_path }}/pxelinux.cfg/default"
owner: "{{ atftp_user }}"
group: "{{ atftp_group }}"

View File

@ -1,17 +0,0 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# module: tftpboot_configure/tasks
# description: Install tftpboot_configure onto an Ubuntu 16.xx server
- include: configure.yml

View File

@ -1,19 +0,0 @@
DEFAULT menu
PROMPT 0
MENU TITLE PXEBoot
TIMEOUT 3
TOTALTIMEOUT 6000
ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
LABEL xenial
kernel /images/xenial/linux
MENU LABEL xenial
append initrd=/images/xenial/initrd.gz ksdevice=bootif netcfg/choose_interface=auto text auto-install/enable=true priority=critical url=http://{{ webserver_ip_address }}/{{ preseed_apache_url }}/xenial hostname=xenial domain=local.lan suite=xenial
ipappend 2
MENU end

View File

@ -1,8 +0,0 @@
default linux
prompt 0
timeout 1
label linux
kernel /images/{{ item.distro }}/linux
ipappend 2
append initrd=/images/{{ item.distro }}/initrd.gz ksdevice=bootif netcfg/choose_interface=auto text auto-install/enable=true priority=critical url=http://{{ webserver_ip_address }}/{{ preseed_apache_url }}/{{ item.preseed_file }} hostname={{ item.name }} domain=local.lan suite={{ item.distro }} biosdevname=0 net.ifnames=0

View File

@ -1,282 +0,0 @@
#
# Ubuntu Server 16.04 Preseed
#
# Usage:
#
# This Ubuntu Preseed file 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 biosdevname=0 net.ifnames=0
#############
#
# Networking
#
#############
d-i netcfg/choose_interface select {{ vm_net_iface }}
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
# Static network configuration.
#d-i netcfg/get_ipaddress string 192.168.0.1
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.0.2
#d-i netcfg/get_nameservers string 8.8.8.8
#d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string cinder_node
d-i netcfg/get_domain string openstackci.local
# 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/{{ vm_disk_device }}. See Ubuntu bug #1347726.
d-i preseed/early_command string \
umount /media || true
#############
#
# 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
#############
#
# Net Image
#
#############
# Required at least for 12.10+
d-i live-installer/net-image string http://{{ tftp_mirror }}/ubuntu/install/filesystem.squashfs
#############
#
# Mirror
#
#############
d-i mirror/country string manual
{% if tftp_proxy != 'blank' %}
d-i mirror/http/proxy string {{ tftp_proxy }}
{% endif %}
d-i mirror/http/hostname string {{ tftp_mirror }}
d-i mirror/http/directory string /ubuntu
#############
#
# 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_server }}
# 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/{{ vm_disk_device }}
# 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/{{ vm_disk_device }}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 python-simplejson
# 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 {{ preseed_password }}
d-i passwd/root-password-again password {{ preseed_password }}
#############
#
# 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 --no-proxy http://{{ webserver_ip_address }}/xenial-sources.list -O /target/etc/apt/sources.list; \
wget --no-proxy http://{{ webserver_ip_address }}/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
mkdir /target/root/.ssh; \
chmod 0700 /target/root/.ssh; \
echo "{{ ssh_key }}" >> /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.
d-i finish-install/reboot_in_progress note

View File

@ -1,276 +0,0 @@
#
# Ubuntu Server 16.04 Preseed
#
# Usage:
#
# This Ubuntu Preseed file 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 biosdevname=0 net.ifnames=0
#############
#
# Networking
#
#############
d-i netcfg/choose_interface select {{ vm_net_iface }}
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
# Static network configuration.
#d-i netcfg/get_ipaddress string 192.168.0.1
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.0.2
#d-i netcfg/get_nameservers string 8.8.8.8
#d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string deploy_node
d-i netcfg/get_domain string openstackci.local
# 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/{{ vm_disk_device }}. See Ubuntu bug #1347726.
d-i preseed/early_command string \
umount /media || true
#############
#
# 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
#############
#
# Net Image
#
#############
# Required at least for 12.10+
d-i live-installer/net-image string http://{{ tftp_mirror }}/ubuntu/install/filesystem.squashfs
#############
#
# Mirror
#
#############
d-i mirror/country string manual
{% if tftp_proxy != 'blank' %}
d-i mirror/http/proxy string {{ tftp_proxy }}
{% endif %}
d-i mirror/http/hostname string {{ tftp_mirror }}
d-i mirror/http/directory string /ubuntu
#############
#
# 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_server }}
# 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/{{ vm_disk_device }}
# 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/{{ vm_disk_device }}2 } \
vg_name{ lxc } \
. \
8192 1 8192 linux-swap \
$lvmok{ } in_vg{ lxc } \
lv_name{ swap00 } \
method{ swap } format{ } \
. \
153600 1 153600 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{ root00 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
label{ root } \
mountpoint{ / } \
. \
# 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 python-simplejson
# 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 {{ preseed_password }}
d-i passwd/root-password-again password {{ preseed_password }}
#############
#
# 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 --no-proxy http://{{ webserver_ip_address }}/xenial-sources.list -O /target/etc/apt/sources.list; \
wget --no-proxy http://{{ webserver_ip_address }}/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
mkdir /target/root/.ssh; \
chmod 0700 /target/root/.ssh; \
echo "{{ ssh_key }}" >> /target/root/.ssh/authorized_keys; \
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.
d-i finish-install/reboot_in_progress note

View File

@ -1,276 +0,0 @@
#
# Ubuntu Server 16.04 Preseed
#
# Usage:
#
# This Ubuntu Preseed file 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 biosdevname=0 net.ifnames=0
#############
#
# Networking
#
#############
d-i netcfg/choose_interface select {{ vm_net_iface }}
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
# Static network configuration.
#d-i netcfg/get_ipaddress string 192.168.0.1
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.0.2
#d-i netcfg/get_nameservers string 8.8.8.8
#d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string infra_node
d-i netcfg/get_domain string openstackci.local
# 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/{{ vm_disk_device }}. See Ubuntu bug #1347726.
d-i preseed/early_command string \
umount /media || true
#############
#
# 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
#############
#
# Net Image
#
#############
# Required at least for 12.10+
d-i live-installer/net-image string http://{{ tftp_mirror }}/ubuntu/install/filesystem.squashfs
#############
#
# Mirror
#
#############
d-i mirror/country string manual
{% if tftp_proxy != 'blank' %}
d-i mirror/http/proxy string {{ tftp_proxy }}
{% endif %}
d-i mirror/http/hostname string {{ tftp_mirror }}
d-i mirror/http/directory string /ubuntu
#############
#
# 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_server }}
# 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/{{ vm_disk_device }}
# 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/{{ vm_disk_device }}2 } \
vg_name{ lxc } \
. \
8192 1 8192 linux-swap \
$lvmok{ } in_vg{ lxc } \
lv_name{ swap00 } \
method{ swap } format{ } \
. \
153600 1 153600 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{ root00 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
label{ root } \
mountpoint{ / } \
. \
# 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 python-simplejson
# 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 {{ preseed_password }}
d-i passwd/root-password-again password {{ preseed_password }}
#############
#
# 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 --no-proxy http://{{ webserver_ip_address }}/xenial-sources.list -O /target/etc/apt/sources.list; \
wget --no-proxy http://{{ webserver_ip_address }}/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
mkdir /target/root/.ssh; \
chmod 0700 /target/root/.ssh; \
echo "{{ ssh_key }}" >> /target/root/.ssh/authorized_keys; \
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.
d-i finish-install/reboot_in_progress note

View File

@ -1,276 +0,0 @@
#
# Ubuntu Server 16.04 Preseed
#
# Usage:
#
# This Ubuntu Preseed file 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 biosdevname=0 net.ifnames=0
#############
#
# Networking
#
#############
d-i netcfg/choose_interface select {{ vm_net_iface }}
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
# Static network configuration.
#d-i netcfg/get_ipaddress string 192.168.0.1
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.0.2
#d-i netcfg/get_nameservers string 8.8.8.8
#d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string logging_node
d-i netcfg/get_domain string openstackci.local
# 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/{{ vm_disk_device }}. See Ubuntu bug #1347726.
d-i preseed/early_command string \
umount /media || true
#############
#
# 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
#############
#
# Net Image
#
#############
# Required at least for 12.10+
d-i live-installer/net-image string http://{{ tftp_mirror }}/ubuntu/install/filesystem.squashfs
#############
#
# Mirror
#
#############
d-i mirror/country string manual
{% if tftp_proxy != 'blank' %}
d-i mirror/http/proxy string {{ tftp_proxy }}
{% endif %}
d-i mirror/http/hostname string {{ tftp_mirror }}
d-i mirror/http/directory string /ubuntu
#############
#
# 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_server }}
# 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/{{ vm_disk_device }}
# 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/{{ vm_disk_device }}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{ / } \
. \
1024 1 1000000000 ext4 \
$lvmok{ } in_vg{ lxc } \
lv_name{ openstack00 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
label{ openstack00 } \
mountpoint{ /openstack } \
. \
# 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 python-simplejson
# 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 {{ preseed_password }}
d-i passwd/root-password-again password {{ preseed_password }}
#############
#
# 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 --no-proxy http://{{ webserver_ip_address }}/xenial-sources.list -O /target/etc/apt/sources.list; \
wget --no-proxy http://{{ webserver_ip_address }}/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
mkdir /target/root/.ssh; \
chmod 0700 /target/root/.ssh; \
echo "{{ ssh_key }}" >> /target/root/.ssh/authorized_keys; \
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.
d-i finish-install/reboot_in_progress note

View File

@ -1,276 +0,0 @@
#
# Ubuntu Server 16.04 Preseed
#
# Usage:
#
# This Ubuntu Preseed file 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 biosdevname=0 net.ifnames=0
#############
#
# Networking
#
#############
d-i netcfg/choose_interface select {{ vm_net_iface }}
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
# Static network configuration.
#d-i netcfg/get_ipaddress string 192.168.0.1
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.0.2
#d-i netcfg/get_nameservers string 8.8.8.8
#d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string network_node
d-i netcfg/get_domain string openstackci.local
# 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/{{ vm_disk_device }}. See Ubuntu bug #1347726.
d-i preseed/early_command string \
umount /media || true
#############
#
# 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
#############
#
# Net Image
#
#############
# Required at least for 12.10+
d-i live-installer/net-image string http://{{ tftp_mirror }}/ubuntu/install/filesystem.squashfs
#############
#
# Mirror
#
#############
d-i mirror/country string manual
{% if tftp_proxy != 'blank' %}
d-i mirror/http/proxy string {{ tftp_proxy }}
{% endif %}
d-i mirror/http/hostname string {{ tftp_mirror }}
d-i mirror/http/directory string /ubuntu
#############
#
# 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_server }}
# 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/{{ vm_disk_device }}
# 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/{{ vm_disk_device }}2 } \
vg_name{ lxc } \
. \
8192 1 8192 linux-swap \
$lvmok{ } in_vg{ lxc } \
lv_name{ swap00 } \
method{ swap } format{ } \
. \
153600 1 153600 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{ root00 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
label{ root } \
mountpoint{ / } \
. \
# 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 python-simplejson
# 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 {{ preseed_password }}
d-i passwd/root-password-again password {{ preseed_password }}
#############
#
# 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 --no-proxy http://{{ webserver_ip_address }}/xenial-sources.list -O /target/etc/apt/sources.list; \
wget --no-proxy http://{{ webserver_ip_address }}/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
mkdir /target/root/.ssh; \
chmod 0700 /target/root/.ssh; \
echo "{{ ssh_key }}" >> /target/root/.ssh/authorized_keys; \
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.
d-i finish-install/reboot_in_progress note

View File

@ -1,300 +0,0 @@
#
# Ubuntu Server 16.04 Preseed
#
# Usage:
#
# This Ubuntu Preseed file 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 biosdevname=0 net.ifnames=0
#############
#
# Networking
#
#############
d-i netcfg/choose_interface select {{ vm_net_iface }}
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
# Static network configuration.
#d-i netcfg/get_ipaddress string 192.168.0.1
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.0.2
#d-i netcfg/get_nameservers string 8.8.8.8
#d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string swift_node
d-i netcfg/get_domain string openstackci.local
# 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/{{ vm_disk_device }}. See Ubuntu bug #1347726.
d-i preseed/early_command string \
umount /media || true
#############
#
# 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
#############
#
# Net Image
#
#############
# Required at least for 12.10+
d-i live-installer/net-image string http://{{ tftp_mirror }}/ubuntu/install/filesystem.squashfs
#############
#
# Mirror
#
#############
d-i mirror/country string manual
{% if tftp_proxy != 'blank' %}
d-i mirror/http/proxy string {{ tftp_proxy }}
{% endif %}
d-i mirror/http/hostname string {{ tftp_mirror }}
d-i mirror/http/directory string /ubuntu
#############
#
# 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_server }}
# 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/{{ vm_disk_device }}
# 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/{{ vm_disk_device }}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{ / } \
. \
20480 1 20480 xfs \
$lvmok{ } in_vg{ lxc } \
lv_name{ swift01 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ xfs } \
label{ openstack00 } \
mountpoint{ /srv/disk1 } \
. \
20480 1 20480 xfs \
$lvmok{ } in_vg{ lxc } \
lv_name{ swift02 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ xfs } \
label{ openstack00 } \
mountpoint{ /srv/disk2 } \
. \
20480 1 20480 xfs \
$lvmok{ } in_vg{ lxc } \
lv_name{ swift03 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ xfs } \
label{ openstack00 } \
mountpoint{ /srv/disk3 } \
. \
76800 1 76800 ext4 \
$lvmok{ } in_vg{ lxc } \
lv_name{ openstack00 } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
label{ openstack00 } \
mountpoint{ /openstack } \
. \
# 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 python-simplejson xfsprogs
# 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 {{ preseed_password }}
d-i passwd/root-password-again password {{ preseed_password }}
#############
#
# 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 --no-proxy http://{{ webserver_ip_address }}/xenial-sources.list -O /target/etc/apt/sources.list; \
wget --no-proxy http://{{ webserver_ip_address }}/osa-$hostname-bridges.cfg -O /target/etc/network/interfaces.d/osa-$hostname-bridges.cfg; \
sed -i '/PermitRootLogin / s/ .*/ yes/' /target/etc/ssh/sshd_config; \
mkdir /target/root/.ssh; \
chmod 0700 /target/root/.ssh; \
echo "{{ ssh_key }}" >> /target/root/.ssh/authorized_keys; \
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.
d-i finish-install/reboot_in_progress note

View File

@ -1,136 +0,0 @@
#!/usr/bin/env bash
set -eu
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Make the rekick function part of the main general shell
declare -f rekick_vms | tee /root/.functions.rc
declare -f ssh_agent_reset | tee -a /root/.functions.rc
if ! grep -q 'source /root/.functions.rc' /root/.bashrc; then
echo 'source /root/.functions.rc' | tee -a /root/.bashrc
fi
# Reset the ssh-agent service to remove potential key issues
ssh_agent_reset
if [ ! -f "/root/.ssh/id_rsa" ];then
ssh-keygen -t rsa -N '' -f /root/.ssh/id_rsa
fi
# This gets the root users SSH-public-key
SSHKEY=${SSHKEY:-$(cat /root/.ssh/id_rsa.pub)}
if ! grep -q "${SSHKEY}" /root/.ssh/authorized_keys; then
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
fi
# This will prevent showing dialogs during iptables-persistent installation?
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
# 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 ntp qemu-utils lxc1 virtualenv \
iptables-persistent
if ! grep "^source.*cfg$" /etc/network/interfaces; then
echo 'source /etc/network/interfaces.d/*.cfg' | tee -a /etc/network/interfaces
fi
# create kvm bridges
cp -v templates/kvm-bonded-bridges.cfg /etc/network/interfaces.d/kvm-bridges.cfg
# set network address
sed -i "s|__NETWORK_BASE__|${NETWORK_BASE}|g" /etc/network/interfaces.d/kvm-bridges.cfg
for i in $(awk '/iface/ {print $2}' /etc/network/interfaces.d/kvm-bridges.cfg); do
ifup $i
done
# Clean up stale NTP processes. This is because of BUG https://bugs.launchpad.net/ubuntu/+source/ntp/+bug/1125726
pkill lockfile-create || true
# Set the forward rule
if ! grep -q '^net.ipv4.ip_forward' /etc/sysctl.conf; then
sysctl -w net.ipv4.ip_forward=1 | tee -a /etc/sysctl.conf
fi
# Add rules from the INPUT chain
iptables_general_rule_add 'INPUT -i br-dhcp -p udp --dport 67 -j ACCEPT'
iptables_general_rule_add 'INPUT -i br-dhcp -p tcp --dport 67 -j ACCEPT'
iptables_general_rule_add 'INPUT -i br-dhcp -p udp --dport 53 -j ACCEPT'
iptables_general_rule_add 'INPUT -i br-dhcp -p tcp --dport 53 -j ACCEPT'
# Add rules from the FORWARDING chain
iptables_general_rule_add 'FORWARD -i br-dhcp -j ACCEPT'
iptables_general_rule_add 'FORWARD -o br-dhcp -j ACCEPT'
# Add rules from the nat POSTROUTING chain
iptables_filter_rule_add nat 'POSTROUTING -s 10.0.0.0/24 ! -d 10.0.0.0/24 -j MASQUERADE'
# To provide internet connectivity to instances
iptables_filter_rule_add nat "POSTROUTING -o $(ip route get 1 | awk '/dev/ {print $5}') -j MASQUERADE"
# Add rules from the mangle POSTROUTING chain
iptables_filter_rule_add mangle 'POSTROUTING -s 10.0.0.0/24 -o br-dhcp -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill'
# To ensure ssh checksum are always correct
iptables_filter_rule_add mangle 'POSTROUTING -p tcp -j CHECKSUM --checksum-fill'
# save the iptables rules
systemctl enable netfilter-persistent
systemctl start netfilter-persistent
invoke-rc.d netfilter-persistent save
# Enable partitioning of the "${DATA_DISK_DEVICE}"
PARTITION_HOST=${PARTITION_HOST:-false}
if [[ "${PARTITION_HOST}" = true ]]; then
# Set the data disk device, if unset the largest unpartitioned device will be used to for host VMs
DATA_DISK_DEVICE="${DATA_DISK_DEVICE:-$(lsblk -brndo NAME,TYPE,FSTYPE,RO,SIZE | awk '/d[b-z]+ disk +0/{ if ($4>m){m=$4; d=$1}}; END{print d}')}"
parted --script /dev/${DATA_DISK_DEVICE} mklabel gpt
parted --align optimal --script /dev/${DATA_DISK_DEVICE} mkpart kvm ext4 0% 100%
mkfs.ext4 $FORCE_PARTITION /dev/${DATA_DISK_DEVICE}1
if ! grep -qw "^/dev/${DATA_DISK_DEVICE}1" /etc/fstab; then
echo "/dev/${DATA_DISK_DEVICE}1 /var/lib/libvirt/images/ ext4 defaults 0 0" >> /etc/fstab
fi
mount -a
fi
# Set the default OVERRIDE_SOURCES var
OVERRIDE_SOURCES=${OVERRIDE_SOURCES:-true}
if ( "${OVERRIDE_SOURCES}" == true )
then
cat > /etc/apt/sources.list <<EOF
# Faster likely unsigned repo
deb [arch=amd64] http://mirror.rackspace.com/ubuntu xenial main universe
deb [arch=amd64] http://mirror.rackspace.com/ubuntu xenial-updates main universe
deb [arch=amd64] http://mirror.rackspace.com/ubuntu xenial-backports main universe
deb [arch=amd64] http://mirror.rackspace.com/ubuntu xenial-security main universe
# i386 comes from the global known repo. This is slower and so it is only used for i386 packages
deb [arch=i386] http://archive.ubuntu.com/ubuntu xenial main universe
deb [arch=i386] http://archive.ubuntu.com/ubuntu xenial-updates main universe
deb [arch=i386] http://archive.ubuntu.com/ubuntu xenial-backports main universe
deb [arch=i386] http://archive.ubuntu.com/ubuntu xenial-security main universe
EOF
fi
# Allow apt repos to be UnAuthenticated
cat > /etc/apt/apt.conf.d/00-nokey <<EOF
APT { Get { AllowUnauthenticated "1"; }; };
EOF

View File

@ -1,39 +0,0 @@
#!/usr/bin/env bash
set -eu
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# set up ssh key in case setup-infra is not run
SSHKEY=${SSHKEY:-$(cat /root/.ssh/id_rsa.pub)}
# Use Ansible to install and configure a DHCP server, TFTP server and Apache
# so we can PXEboot all the VMs
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
systemctl enable isc-dhcp-server
systemctl enable atftpd
systemctl start isc-dhcp-server
systemctl start atftpd
# Create a xenial sources file for the VMs to download
cp -v templates/xenial-sources.list /var/www/html/xenial-sources.list

View File

@ -1,37 +0,0 @@
#!/usr/bin/env bash
set -eu
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Remove the default libvirt networks
if virsh net-list | grep -qw "default"; then
virsh net-autostart default --disable
virsh net-destroy default
fi
# Create the libvirt networks used for the Host VMs
for network in br-dhcp vm-br-eth1 vm-br-eth2 vm-br-eth3 vm-br-eth4 vm-br-eth5; do
if ! virsh net-list | grep -qw "${network}"; then
sed "s/__NETWORK__/${network}/g" templates/libvirt-network.xml > /etc/libvirt/qemu/networks/${network}.xml
virsh net-define --file /etc/libvirt/qemu/networks/${network}.xml
virsh net-create --file /etc/libvirt/qemu/networks/${network}.xml
virsh net-autostart ${network}
fi
done

View File

@ -1,69 +0,0 @@
# VLAN TAGS
# 1100 - MANAGEMENT_NET
# 1200 - OVERLAY_NET
# 1300 - STORAGE_NET
# 1400 - FLAT_NET
#### BRIDGES USED FOR VM INTERFACES ####
# MANAGEMENT Network
auto vm-br-eth1
iface vm-br-eth1 inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address __NETWORK_BASE__.236.200
netmask 255.255.252.0
offload-sg off
# FLAT Network
auto vm-br-eth2
iface vm-br-eth2 inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address __NETWORK_BASE__.248.1
netmask 255.255.252.0
offload-sg off
# VLAN Network
auto vm-br-eth3
iface vm-br-eth3 inet manual
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
offload-sg off
# TUNNEL Network
auto vm-br-eth4
iface vm-br-eth4 inet manual
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
offload-sg off
# STORAGE Network
auto vm-br-eth5
iface vm-br-eth5 inet manual
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
offload-sg off
#### INTERFACES USED FOR VM BRIDGES ####
#### SYSTEM INTEGRATION DEVICES ####
auto br-dhcp
iface br-dhcp inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.0.0.200
netmask 255.255.255.0
offload-sg off
#### SYSTEM INTEGRATION DEVICES ####

View File

@ -1,5 +0,0 @@
<network>
<name>__NETWORK__</name>
<forward mode="bridge"/>
<bridge name="__NETWORK__"/>
</network>

View File

@ -1,76 +0,0 @@
## Physical interface, could be bond. This only needs to be set once for the physical device
# MANAGEMENT Network
auto __ETH_TYPE__1
iface __ETH_TYPE__1 inet manual
# FLAT Network
auto __ETH_TYPE__2
iface __ETH_TYPE__2 inet manual
# VLAN Network
auto __ETH_TYPE__3
iface __ETH_TYPE__3 inet manual
# TUNNEL Network
auto __ETH_TYPE__4
iface __ETH_TYPE__4 inet manual
# STORAGE Network
auto __ETH_TYPE__5
iface __ETH_TYPE__5 inet manual
auto br-mgmt
iface br-mgmt inet static
bridge_stp off
bridge_waitport 10
bridge_fd 0
bridge_ports __ETH_TYPE__1
address __NETWORK_BASE__.236.__COUNT__
netmask 255.255.252.0
offload-sg off
auto br-flat
iface br-flat inet static
bridge_stp off
bridge_waitport 10
bridge_fd 0
bridge_ports __ETH_TYPE__2
address __NETWORK_BASE__.248.__COUNT__
netmask 255.255.252.0
offload-sg off
auto br-vlan
iface br-vlan inet manual
bridge_stp off
bridge_waitport 10
bridge_fd 0
bridge_ports __ETH_TYPE__3
offload-sg off
auto br-vxlan
iface br-vxlan inet static
bridge_stp off
bridge_waitport 10
bridge_fd 0
bridge_ports __ETH_TYPE__4
address __NETWORK_BASE__.240.__COUNT__
netmask 255.255.252.0
offload-sg off
# To ensure ssh checksum is correct
up /sbin/iptables -A POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
down /sbin/iptables -D POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
# To provide internet connectivity to instances
up /sbin/iptables -t nat -A POSTROUTING -o __DEFAULT_NETWORK__ -j MASQUERADE
down /sbin/iptables -t nat -D POSTROUTING -o __DEFAULT_NETWORK__ -j MASQUERADE
# Make sure instances can talk to the metadata server
up /sbin/iptables -t mangle -A POSTROUTING -p tcp --sport 80 -j CHECKSUM --checksum-fill
auto br-storage
iface br-storage inet static
bridge_stp off
bridge_waitport 10
bridge_fd 0
bridge_ports __ETH_TYPE__5
address __NETWORK_BASE__.244.__COUNT__
netmask 255.255.252.0
offload-sg off

View File

@ -1,75 +0,0 @@
---
cidr_networks:
container: __NETWORK_BASE__.236.0/22
tunnel: __NETWORK_BASE__.240.0/22
storage: __NETWORK_BASE__.244.0/22
used_ips:
- "__NETWORK_BASE__.236.0,__NETWORK_BASE__.236.200"
- "__NETWORK_BASE__.240.0,__NETWORK_BASE__.240.200"
- "__NETWORK_BASE__.244.0,__NETWORK_BASE__.244.200"
- "__NETWORK_BASE__.248.0,__NETWORK_BASE__.248.200"
global_overrides:
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__"
tunnel_bridge: "br-vxlan"
management_bridge: "br-mgmt"
provider_networks:
- network:
container_bridge: "br-mgmt"
container_type: "veth"
container_interface: "eth1"
ip_from_q: "container"
type: "raw"
group_binds:
- all_containers
- hosts
is_container_address: true
is_ssh_address: true
- network:
container_bridge: "br-vxlan"
container_type: "veth"
container_interface: "eth10"
ip_from_q: "tunnel"
type: "vxlan"
range: "1:1000"
net_name: "vxlan"
group_binds:
- neutron_linuxbridge_agent
- network:
container_bridge: "br-flat"
container_type: "veth"
container_interface: "eth12"
type: "flat"
net_name: "flat"
group_binds:
- neutron_linuxbridge_agent
- utility_all
- network:
container_bridge: "br-vlan"
container_type: "veth"
container_interface: "eth11"
type: "vlan"
range: "1:1"
net_name: "vlan"
group_binds:
- neutron_linuxbridge_agent
- network:
container_bridge: "br-storage"
container_type: "veth"
container_interface: "eth2"
ip_from_q: "storage"
type: "raw"
group_binds:
- glance_api
- cinder_api
- cinder_volume
- nova_compute
- swift_proxy
haproxy_hosts:
loadbalancer1:
ip: __NETWORK_BASE__.236.150

View File

@ -1,16 +0,0 @@
---
global_overrides:
swift:
part_power: 8
storage_network: 'br-storage'
replication_network: 'br-storage'
drives:
- name: disk1
- name: disk2
- name: disk3
mount_point: /srv
storage_policies:
- policy:
name: default
index: 0
default: True

View File

@ -1,131 +0,0 @@
<domain type='kvm'>
<name>__NODE__.openstackci.local</name>
<memory unit='GiB'>12</memory>
<currentMemory unit='GiB'>4</currentMemory>
<vcpu placement='static'>2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-__CONTAINER_VMS__'>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='9216' 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>

View File

@ -1,131 +0,0 @@
<domain type='kvm'>
<name>__NODE__.openstackci.local</name>
<memory unit='GiB'>4</memory>
<currentMemory unit='GiB'>4</currentMemory>
<vcpu placement='static'>4</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>

View File

@ -1,131 +0,0 @@
<domain type='kvm'>
<name>__NODE__.openstackci.local</name>
<memory unit='GiB'>12</memory>
<currentMemory unit='GiB'>12</currentMemory>
<vcpu placement='static'>10</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-__CONTAINER_VMS__'>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='9216' 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>

View File

@ -1,131 +0,0 @@
<domain type='kvm'>
<name>__NODE__.openstackci.local</name>
<memory unit='GiB'>2</memory>
<currentMemory unit='GiB'>2</currentMemory>
<vcpu placement='static'>2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-__CONTAINER_VMS__'>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='9216' 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>

View File

@ -1,131 +0,0 @@
<domain type='kvm'>
<name>__NODE__.openstackci.local</name>
<memory unit='GiB'>12</memory>
<currentMemory unit='GiB'>6</currentMemory>
<vcpu placement='static'>4</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-__CONTAINER_VMS__'>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='9216' 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>

View File

@ -1,131 +0,0 @@
<domain type='kvm'>
<name>__NODE__.openstackci.local</name>
<memory unit='GiB'>24</memory>
<currentMemory unit='GiB'>8</currentMemory>
<vcpu placement='static'>8</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-__CONTAINER_VMS__'>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='9216' 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>

View File

@ -1,131 +0,0 @@
<domain type='kvm'>
<name>__NODE__.openstackci.local</name>
<memory unit='GiB'>4</memory>
<currentMemory unit='GiB'>4</currentMemory>
<vcpu placement='static'>4</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-__CONTAINER_VMS__'>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='9216' 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>

View File

@ -1,20 +0,0 @@
deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb http://archive.ubuntu.com/ubuntu xenial universe
deb-src http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
deb-src http://archive.ubuntu.com/ubuntu xenial-updates universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-updates multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

View File

@ -1,74 +0,0 @@
# Variables used by multi-node-aio
# Network subnet used for all the virtual machines
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="${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="${OVERRIDE_SOURCES:-false}"
# What branch of Openstack-Ansible are we deploying from
OSA_BRANCH="${OSA_BRANCH:-stable/newton}"
# What is the default disk device name
DEVICE_NAME="${DEVICE_NAME:-vda}"
# What default network device should we use
DEFAULT_NETWORK="${DEFAULT_NETWORK:-eth0}"
# What is the default virtual machine disk size in GB
VM_DISK_SIZE="${VM_DISK_SIZE:-252}"
# Do we want to do all the required host setup
SETUP_HOST="${SETUP_HOST:-true}"
# What fisk shall we use for the default data
DATA_DISK_DEVICE="${DATA_DISK_DEVICE:-sdb}"
# Do we want to do disk partitioning or is there a partition ready to use
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="${SETUP_VIRSH_NET:-true}"
# When the virtual machines are re-kicked do we format them
VM_IMAGE_CREATE="${VM_IMAGE_CREATE:-true}"
# Should we run the deploy Openstack-Ansible script at the end of the build script
DEPLOY_OSA="${DEPLOY_OSA:-true}"
# Should we pre-configure the environment before we deploy OpenStack-Ansible
PRE_CONFIG_OSA="${PRE_CONFIG_OSA:-true}"
# Should we run the final deploy of OpenStack-Ansible
RUN_OSA="${RUN_OSA:-true}"
# Should we use PXEboot
SETUP_PXEBOOT="${SETUP_PXEBOOT:-true}"
# Should we create the virtual machines
CREATE_VMS="${CREATE_VMS:-true}"
# Should we configure the virtual machines
CONFIGURE_VMS="${CONFIGURE_VMS:-true}"
# Container vms - override the container virtual machines with 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="${ETH_TYPE:-eth}"
# Default service ports
OSA_PORTS="${OSA_PORTS:-6080 6082 443 80}"
# Config the baremetal host, treat the baremetal host as a switch
# put all deploy job into deploy node.
CONFIG_PREROUTING="${CONFIG_PREROUTING:-true}"

View File

@ -1,229 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Files in this project licensed under the MIT license:
- playbooks/plugins/callbacks/profile_tasks.py

View File

@ -12,7 +12,7 @@ Full OpenStack deployment using a single OnMetal host from the
Rackspace Public Cloud. This is a multi-node installation using
VMs that have been PXE booted which was done to provide an environment
that is almost exactly what is in production. This script will build, kick
and deploy OpenStack using KVM, Cobbler, OpenStack-Ansible within 13 Nodes
and deploy OpenStack using KVM, OpenStack-Ansible within 12 Nodes
and 1 load balancer all using a Hyper Converged environment.
@ -20,17 +20,16 @@ Process
-------
Create at least one physical host that has public network access and is running the
Ubuntu 14.04 LTS (Trusty Tahr) Operating system. This script assumes that you have
an unpartitioned device with at least 1TB of storage. If you're using the Rackspace
Ubuntu 14/6.04 LTS Operating system. System assumes that you have an unpartitioned
device with at least 1TB of storage, however you can customize the size of each VM
volume by setting the option ``${VM_DISK_SIZE}``. If you're using the Rackspace
OnMetal servers the drive partitioning will be done for you by detecting the largest
unpartitioned device. If you're doing the deployment on something other than a Rackspace
OnMetal server you may need to modify the ``setup-host.sh`` script to do the needful in
your environment. If you know the device name you want to format you can also set the
``${DATA_DISK_DEVICE}`` variable accordingly.
Physical disk partitioning can be skipped by setting ``PARTITION_HOST=false``. If you set
this, make sure you have enough space available to run all of the infrastructure VMs within
``/var/lib/libvirt/images``.
OnMetal server you may need to set the ``${DATA_DISK_DEVICE}`` variable accordingly.
the playbooks will look for a volume group named "vg01", if this volume group exists
no partitioning or setup on the data disk will take place. To effectively use this
process for testing it's recommended that the host machine have at least 32GiB of
RAM.
=========== ======== ============
Physical Host Specs known to work well
@ -85,56 +84,42 @@ Console Access
:alt: Screen shot of virt-manager console
:align: center
The root password for all VMs is "**cobbler**". This password is being set within the pre-seed files under the
The root password for all VMs is "**secrete**". This password is being set within the pre-seed files under the
"Users and Password" section. If you want to change this password please edit the pre-seed files.
Notes
-----
The cobbler and pre-seed setup has been implemented using some of the awesome work originally created by James Thorne.
* cobbler installation post - https://thornelabs.net/2015/11/26/install-and-configure-cobbler-on-ubuntu-1404.html
* pre-seeds -- https://github.com/jameswthorne/preseeds
Options
-------
Set the default preseed device name. This is being set because sda is on hosts, vda is kvm, xvda is xen:
``DEVICE_NAME="${DEVICE_NAME:-vda}"``
``build.sh`` Options
--------------------
Set to instruct the preseed what the default network is expected to be:
``DEFAULT_NETWORK="${DEFAULT_NETWORK:-eth0}"``
Set the data disk device, if unset the largest unpartitioned device will be used to for host VMs:
``DATA_DISK_DEVICE="${DATA_DISK_DEVICE:-$(lsblk -brndo NAME,TYPE,FSTYPE,RO,SIZE | awk '/d[b-z]+ disk +0/{ if ($4>m){m=$4; d=$1}}; END{print d}')}"``
Set the VM disk size in gigabytes:
``VM_DISK_SIZE="${VM_DISK_SIZE:-252}"``
Set the OSA branch for this script to deploy:
``OSA_BRANCH=${OSA_BRANCH:-master}``
Enable partitioning of the "${DATA_DISK_DEVICE}":
``PARTITION_HOST=${PARTITION_HOST:-true}``
Instruct the system do all of the required host setup:
``SETUP_HOST=${SETUP_HOST:-true}``
Instruct the system do all of the required PXE setup:
``SETUP_PXEBOOT=${SETUP_PXEBOOT:-true}``
Instruct the system do all of the required DHCPD setup:
``SETUP_DHCPD=${SETUP_DHCPD:-true}``
Instruct the system to deploy OpenStack Ansible:
``DEPLOY_OSA=${DEPLOY_OSA:-true}``
Instruct the system to Kick all of the VMs:
``DEPLOY_VMS=${DEPLOY_VMS:-true}``
Instruct the system to run VM disk image create:
``VM_IMAGE_CREATE=${VM_IMAGE_CREATE:-true}``
Instruct the VM to use the selected image, eg. ubuntu-16.04-amd64:
``DEFAULT_IMAGE=${DEFAULT_IMAGE:-ubuntu-16.04-amd64}``
Instruct the system do all of the require host setup:
``SETUP_HOST=${SETUP_HOST:-true}``
Instruct the system do all of the cobbler setup:
``SETUP_COBBLER=${SETUP_COBBLER:-true}``
Set the OSA branch for this script to deploy:
``OSA_BRANCH=${OSA_BRANCH:-master}``
Instruct the system do all of the virsh network setup:
``SETUP_VIRSH_NET=${SETUP_VIRSH_NET:-true}``
Instruct the system to deploy OpenStack Ansible:
``DEPLOY_OSA=${DEPLOY_OSA:-true}``
Instruct the system to pre-config the envs for running OSA playbooks:
``PRE_CONFIG_OSA=${PRE_CONFIG_OSA:-true}``
@ -142,57 +127,48 @@ Instruct the system to pre-config the envs for running OSA playbooks:
Instruct the system to run the OSA playbooks, if you want to deploy other OSA powered cloud, you can set it to false:
``RUN_OSA=${RUN_OSA:-true}``
Instruct the VM to use the selected image, eg. ubuntu xenial:
``DEFAULT_IMAGE=${DEFAULT_IMAGE:-16.04}``
Install the specified kernel, eg 3.13.0-34 if you want to deploy Juno release.
``DEFAULT_KERNEL=${DEFAULT_KERNEL:-3.13.0-34}``
Re-kicking VM(s)
----------------
Configure the prerouting iptable rules after the OSA deployment
``CONFIG_PREROUTING="${CONFIG_PREROUTING:-true}``
Re-kicking a VM is as simple as stopping a VM, delete the logical volume, create a new logical volume, start the VM.
The VM will come back online, pxe boot, and install the base OS.
Re-kicking the VMs
------------------
.. code-block:: bash
The build process will add a function to the system to provide you a quick means to re-kick a VM host. The function added
is ``rekick_vms``. This function can be used to re-kick a specific host. To use this function use the short hostname along
with the function. EXAMPLE: ``rekick_vms infra1``. This command will destroy the root disk for the VM and reboot it causing
it to be re-PXE booted. Once the re-deployment has completed (<=10 min) the node will have a vanilla OS.
If you want to re-kick all known hosts you can execute the ``deploy-vms.sh`` script which will do everything needed to
boot all new VMs paving over the existing ones.
virsh destroy "${VM_NAME}"
lvremove "/dev/mapper/vg01--${VM_NAME}"
lvcreate -L 60G vg01 -n "${VM_NAME}"
virsh start "${VM_NAME}"
Adding nodes to the deployment
------------------------------
To rekick all VMs, the following command can be used on the host machine to cycle through all found VMs and re-provision them.
To add nodes to the deployment simply add the node entries to the hosts.json file. The file divides nodes by type and you
can add more nodes to any of the available types without any modifications made to the templates or build script. The first
100 IP address of all used CIDRs have been reserved in the ``openstack_user_config.yml`` and can be used when adding
additional hosts to the environment.
.. code-block:: bash
for VM_NAME in $(virsh list --all | awk '/running/ || /shut/ {print $2}'); do
virsh destroy "${VM_NAME}"
lvremove "/dev/mapper/vg01--${VM_NAME}"
lvcreate -L 60G vg01 -n "${VM_NAME}"
virsh start "${VM_NAME}"
done
Rerunning the build script
--------------------------
The build script can be rerun at any time. If you have a successful run before and simply want to re-kick everything I
recommend nuking the running VMs and then executing the build script instructing it to NOT partition the host. This can
be easily done using the following snippet.
.. code-block:: bash
for i in $(virsh list --all --name); do virsh destroy $i; virsh undefine $i; rm /var/lib/libvirt/images/$i.img; done
rm ~/.ssh/known_hosts; PARTITION_HOST=false ./build.sh
recommend nuking VMs and then executing the build script.
Deploying OpenStack into the environment
----------------------------------------
While the build script will deploy OpenStack, you can choose to run this manually. To run a basic deploy using a given branch you can use the following snippet.
While the build script will deploy OpenStack, you can choose to run this manually. To run a basic deploy using a given branch you can use the following snippet. Set the ansible option ``osa_branch`` or export the environment variable ``OSA_BRANCH`` when using the build.sh script.
.. code-block:: bash
OSA_BRANCH=master ./deploy-osa.sh
ansible-playbook -i playbooks/inventory playbooks/deploy-osa.yml -vv -e 'osa_branch=master'
Snapshotting an environment before major testing

View File

@ -0,0 +1,19 @@
export ANSIBLE_GATHERING="${ANSIBLE_GATHERING:-smart}"
export ANSIBLE_GATHER_SUBSET="${ANSIBLE_GATHER_SUBSET:-network,hardware,virtual}"
export ANSIBLE_CACHE_PLUGIN="${ANSIBLE_CACHE_PLUGIN:-jsonfile}"
export ANSIBLE_CACHE_PLUGIN_CONNECTION="${ANSIBLE_CACHE_PLUGIN_CONNECTION:-/tmp/mnaio_facts}"
export ANSIBLE_CACHE_PLUGIN_TIMEOUT="${ANSIBLE_CACHE_PLUGIN_TIMEOUT:-86400}"
export ANSIBLE_HOST_KEY_CHECKING=False
export ANSIBLE_SSH_CONTROL_PATH=/tmp/%%h-%%r
export ANSIBLE_SSH_ARGS="-o ControlMaster=no \
-o UserKnownHostsFile=/dev/null \
-o StrictHostKeyChecking=no \
-o ServerAliveInterval=64 \
-o ServerAliveCountMax=1024 \
-o Compression=no \
-o TCPKeepAlive=yes \
-o VerifyHostKeyDNS=no \
-o ForwardX11=no \
-o ForwardAgent=yes"

86
multi-node-aio/bootstrap.sh Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env bash
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o pipefail
set -euov
BINDEP_FILE=${BINDEP_FILE:-bindep.txt}
source /etc/os-release || source /usr/lib/os-release
case "${ID,,}" in
*suse*)
# Need to pull libffi and python-pyOpenSSL early
# because we install ndg-httpsclient from pip on Leap 42.1
[[ "${VERSION}" == "42.1" ]] && extra_suse_deps="libffi-devel python-pyOpenSSL"
sudo zypper -n in python-devel lsb-release ${extra_suse_deps:-}
;;
amzn|centos|rhel)
sudo yum install -y python-devel redhat-lsb-core
;;
ubuntu|debian)
sudo apt-get update && sudo apt-get install -y python-dev lsb-release
;;
*)
echo "Unsupported distribution: ${ID,,}"
exit 1
esac
# Install pip
if ! which pip &>/dev/null; then
curl --silent --show-error --retry 5 \
https://bootstrap.pypa.io/get-pip.py | sudo python2.7
fi
# Install bindep and tox
sudo pip install 'bindep>=2.4.0' tox
# CentOS 7 requires two additional packages:
# redhat-lsb-core - for bindep profile support
# epel-release - required to install python-ndg_httpsclient/python2-pyasn1
if [[ ${ID,,} == "centos" ]]; then
sudo yum -y install redhat-lsb-core epel-release yum-utils
# epel-release could be installed but not enabled (which is very common
# in openstack-ci) so enable it here if needed
sudo yum-config-manager --enable epel || true
# openSUSE 42.1 does not have python-ndg-httpsclient
elif [[ ${ID,,} == *suse* ]] && [[ ${VERSION} == "42.1" ]]; then
sudo pip install ndg-httpsclient
fi
# Get a list of packages to install with bindep. If packages need to be
# installed, bindep exits with an exit code of 1.
BINDEP_PKGS=$(bindep -b -f ${BINDEP_FILE} test || true)
echo "Packages to install: ${BINDEP_PKGS}"
# Install OS packages using bindep
if [[ ${#BINDEP_PKGS} > 0 ]]; then
case "${ID,,}" in
*suse*)
sudo zypper -n in $BINDEP_PKGS
;;
centos)
sudo yum install -y $BINDEP_PKGS
;;
ubuntu|debian)
sudo apt-get update
DEBIAN_FRONTEND=noninteractive \
sudo apt-get -q --option "Dpkg::Options::=--force-confold" \
--assume-yes install $BINDEP_PKGS
;;
esac
fi
sudo pip install ansible

View File

@ -1,5 +1,4 @@
#!/usr/bin/env bash
set -eu
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -14,28 +13,23 @@ set -eu
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
set -euvo
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
source bootstrap.sh
# Instruct the system do all of the require host setup
SETUP_HOST=${SETUP_HOST:-true}
[[ "${SETUP_HOST}" = true ]] && source setup-host.sh
source ansible-env.rc
# Instruct the system do all of the cobbler setup
SETUP_COBBLER=${SETUP_COBBLER:-true}
[[ "${SETUP_COBBLER}" = true ]] && source setup-cobbler.sh
# Instruct the system do all of the virsh setup
SETUP_VIRSH_NET=${SETUP_VIRSH_NET:-true}
[[ "${SETUP_VIRSH_NET}" = true ]] && source setup-virsh-net.sh
# Instruct the system to Kick all of the VMs
DEPLOY_VMS=${DEPLOY_VMS:-true}
[[ "${DEPLOY_VMS}" = true ]] && source deploy-vms.sh
# Instruct the system to deploy OpenStack Ansible
DEPLOY_OSA=${DEPLOY_OSA:-true}
[[ "${DEPLOY_OSA}" = true ]] && source config-deploy-node.sh
ansible-playbook -i playbooks/inventory \
-e setup_host=${SETUP_HOST:-"true"} \
-e setup_pxeboot=${SETUP_PXEBOOT:-"true"} \
-e setup_dhcpd=${SETUP_DHCPD:-"true"} \
-e deploy_vms=${DEPLOY_VMS:-"true"} \
-e deploy_osa=${DEPLOY_OSA:-"true"} \
-e osa_branch=${OSA_BRANCH:-"master"} \
-e default_network=${DEFAULT_NETWORK:-"eth0"} \
-e default_image=${DEFAULT_IMAGE:-"ubuntu-16.04-amd64"} \
-e vm_disk_size=${VM_DISK_SIZE:-61440} \
-e http_proxy=${http_proxy:-''} \
-e run_osa=${RUN_OSA:-"true"} \
-e pre_config_osa=${PRE_CONFIG_OSA:-"true"} \
playbooks/site.yml

View File

@ -1,31 +0,0 @@
#!/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
if [[ "${DEPLOY_OSA}" = true ]]; then
# 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"
fi
if [[ "${CONFIG_PREROUTING}" = true ]]; then
EXTERNAL_IP="$(ip route get 1 | awk '{print $NF;exit}')"
# Add 2222 rules to iptables for ssh directly into deployment node.
iptables_filter_rule_add nat "PREROUTING -p tcp -d ${EXTERNAL_IP} --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 -d ${EXTERNAL_IP} --dport ${port} -j DNAT --to 10.0.0.150:${port}"
done
fi

View File

@ -1,150 +0,0 @@
#!/usr/bin/env bash
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
MAX_RETRIES=${MAX_RETRIES:-5}
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Provide defaults for unset variables
# Set first two octets of network used for containers, storage, etc
NETWORK_BASE=${NETWORK_BASE:-172.29}
# Reset the ssh-agent service to remove potential key issues
ssh_agent_reset
# Install git and tmux for use within the OSA deploy
apt-get install -y git tmux
# Clone the OSA source code
git clone https://git.openstack.org/openstack/openstack-ansible /opt/openstack-ansible || true
# Ensure the "/etc/openstack_deploy" exists
mkdir_check "/etc/openstack_deploy"
pushd /opt/openstack-ansible/
# Fetch all current refs
git fetch --all
# Checkout the OpenStack-Ansible branch
git checkout "${OSA_BRANCH:-master}"
# Copy the etc files into place
cp -vR etc/openstack_deploy/* /etc/openstack_deploy/
popd
# Create a secondary static inventory for hosts
ansible_static_inventory "/opt/ansible-static-inventory.ini"
# Create the OpenStack User Config
HOSTIP="$(ip route get 1 | awk '{print $NF;exit}')"
sed -e "s/__HOSTIP__/${HOSTIP}/g" -e "s/__NETWORK_BASE__/${NETWORK_BASE}/g" templates/openstack_user_config.yml > /etc/openstack_deploy/openstack_user_config.yml
# Create the swift config: function group_name host_type
cp -v templates/osa-swift.yml /etc/openstack_deploy/conf.d/swift.yml
### =========== WRITE OF conf.d FILES =========== ###
# Setup cinder hosts: function group_name host_type
write_osa_general_confd storage-infra_hosts cinder
write_osa_cinder_confd storage_hosts cinder
# Setup nova hosts: function group_name host_type
write_osa_general_confd compute_hosts nova_compute
# Setup infra hosts: function group_name host_type
write_osa_general_confd identity_hosts infra
write_osa_general_confd repo-infra_hosts infra
write_osa_general_confd os-infra_hosts infra
write_osa_general_confd shared-infra_hosts infra
# Setup logging hosts: function group_name host_type
write_osa_general_confd log_hosts logging
# Setup network hosts: function group_name host_type
write_osa_general_confd network_hosts infra
# Setup swift hosts: function group_name host_type
write_osa_swift_proxy_confd swift-proxy_hosts swift
write_osa_swift_storage_confd swift_hosts swift
### =========== END WRITE OF conf.d FILES =========== ###
# Enable pre-config the OSA enviroment for deploying OSA.
PRE_CONFIG_OSA=${PRE_CONFIG_OSA:-true}
if [[ "${PRE_CONFIG_OSA}" = true ]]; then
pushd /opt/openstack-ansible/
# Bootstrap ansible into the environment
bash ./scripts/bootstrap-ansible.sh
# Generate the passwords for the environment
python ./scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
# This is happening so the VMs running the infra use less storage
osa_user_var_add lxc_container_backing_store 'lxc_container_backing_store: dir'
# Tempest is being configured to use a known network
osa_user_var_add tempest_public_subnet_cidr 'tempest_public_subnet_cidr: '${NETWORK_BASE}'.248.0/26'
# This makes running neutron in a distributed system easier and a lot less noisy
osa_user_var_add neutron_l2_population 'neutron_l2_population: True'
# This makes the glance image store use swift instead of the file backend
osa_user_var_add glance_default_store 'glance_default_store: swift'
# Propagate host proxy settings (if set) into /etc/environment in the targets
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:'
osa_user_var_add ' HTTP_PROXY:' ' HTTP_PROXY: "{{ proxy_env_url }}"'
osa_user_var_add ' HTTPS_PROXY:' ' HTTPS_PROXY: "{{ proxy_env_url }}"'
osa_user_var_add ' NO_PROXY:' ' NO_PROXY: "{{ no_proxy_env }}"'
osa_user_var_add ' http_proxy:' ' http_proxy: "{{ proxy_env_url }}"'
osa_user_var_add ' https_proxy:' ' https_proxy: "{{ proxy_env_url }}"'
osa_user_var_add ' no_proxy:' ' no_proxy: "{{ no_proxy_env }}"'
# Propagate proxy setting to glance api conf. Note the unusual format - instead of the typical
# http_proxy=http://proxy.example.com ; https_proxy=http://proxy.example.com
# it uses
# http:proxy.example.com, https:proxy.example.com
#
osa_user_var_add glance_glance_api_conf_overrides 'glance_glance_api_conf_overrides:'
osa_user_var_add ' glance_store' ' glance_store:'
osa_user_var_add ' http_proxy_information' " http_proxy_information: \"http:${http_proxy#http://}, https:${http_proxy#http://}\""
fi
popd
fi
# Enable deploy OSA of the "${RUN_OSA}"
RUN_OSA=${RUN_OSA:-true}
if [[ "${RUN_OSA}" = true ]]; then
# Set the number of forks for the ansible client calls
export ANSIBLE_FORKS=${ANSIBLE_FORKS:-15}
pushd /opt/openstack-ansible
export DEPLOY_AIO=true
bash ./scripts/run-playbooks.sh
popd
EXEC_DIR="$(pwd)"
pushd /opt/openstack-ansible/playbooks
if [[ -f "/usr/local/bin/openstack-ansible.rc" ]]; then
source /usr/local/bin/openstack-ansible.rc
fi
ansible -m script -a "${EXEC_DIR}/openstack-service-setup.sh ${NETWORK_BASE}" 'utility_all[0]'
popd
fi

View File

@ -1,105 +0,0 @@
#!/usr/bin/env bash
set -eu
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Load all functions
source functions.rc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Reset the ssh-agent service to remove potential key issues
ssh_agent_reset
# Set the default preseed device name.
# This is being set because sda is on hosts, vda is kvm, xvda is xen.
DEVICE_NAME="${DEVICE_NAME:-vda}"
# Create VM Basic Configuration files
for node_type in $(get_all_types); do
for node in $(get_host_type ${node_type}); do
cp -v "templates/vmnode-config/${node_type}.openstackci.local.xml" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
sed -i "s|__NODE__|${node%%":"*}|g" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
sed -i "s|__COUNT__|${node:(-2)}|g" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
sed -i "s|__DEVICE_NAME__|${DEVICE_NAME}|g" /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml
done
done
# Populate network configurations based on node type
for node_type in $(get_all_types); do
for node in $(get_host_type ${node_type}); do
sed -e "s/__COUNT__/${node#*":"}/g" -e "s/__NETWORK_BASE__/${NETWORK_BASE}/g" "templates/network-interfaces/vm.openstackci.local-bonded-bridges.cfg" > "/var/www/html/osa-${node%%":"*}.openstackci.local-bridges.cfg"
done
done
# Kick all of the VMs to run the cloud
# !!!THIS TASK WILL DESTROY ALL OF THE ROOT DISKS IF THEY ALREADY EXIST!!!
rekick_vms
# Wait here for all nodes to be booted and ready with SSH
wait_ssh
# Export all system keys
mkdir -p /tmp/keys
for i in $(apt-key list | awk '/pub/ {print $2}' | awk -F'/' '{print $2}'); do
apt-key export "$i" > "/tmp/keys/$i"
done
# Get the ubuntu release version from VMs.
RELEASE_VERSION=`ssh -q -o StrictHostKeyChecking=no 10.0.0.100 "lsb_release -sr"`
# Ensure that all running VMs have an updated apt-cache with keys
for node in $(get_all_hosts); do
ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "mkdir -p /tmp/keys"
for i in /etc/apt/apt.conf.d/00-nokey /etc/apt/sources.list /tmp/sources.list /etc/apt/sources.list.d/* /tmp/keys/*; do
if [[ -f "$i" ]]; then
scp "$i" "10.0.0.${node#*":"}:$i"
fi
done
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 -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

View File

@ -1,257 +0,0 @@
#!/usr/bin/env bash
# Copyright [2016] [Kevin Carter]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function mkdir_check {
if [ ! -d "$1" ];then
mkdir -p "$1"
fi
}
function ssh_agent_reset {
# If you were running ssh-agent with forwarding this will clear out the keys
# in your cache which can cause confusion.
if pgrep ssh-agent; then
killall ssh-agent; eval `ssh-agent`
fi
}
function iptables_general_rule_add {
if ! iptables -w -C $1;then
iptables -w -I $1
fi
}
function iptables_filter_rule_add {
if ! iptables -w -t $1 -C $2;then
iptables -w -t $1 -I $2
fi
}
function get_host_type {
python <<EOL
import json
with open('hosts.json') as f:
x = json.loads(f.read())
for k, v in x.get("$1").items():
print('%s:%s' % (k, v))
EOL
}
function get_all_hosts {
python <<EOL
import json
with open('hosts.json') as f:
x = json.loads(f.read())
for i in x.values():
for k, v in i.items():
print('%s:%s' % (k, v))
EOL
}
function get_all_types {
python <<EOL
import json
with open('hosts.json') as f:
x = json.loads(f.read())
for i in x.keys():
print(i)
EOL
}
function wait_ssh {
echo "Waiting for all nodes to become available. This can take around ${1:-10} min"
for node in $(get_all_hosts); do
echo "Waiting for node: ${node%%":"*} on 10.0.0.${node#*":"}"
until ssh -q -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=10 10.0.0.${node#*':'} exit > /dev/null; do
sleep 15
done
done
}
function rekick_vms {
# If you pass the short name of the host to the function it will only force rekick just the ONE host.
# Set the VM disk size in gigabytes
VM_DISK_SIZE="${VM_DISK_SIZE:-252}"
for node in ${1:-$(get_all_hosts)}; do
for node_name in $(virsh list --all --name | grep "${node%%":"*}"); do
virsh destroy "${node_name}" || true
done
# Instruct the system to run the image create.
# If you have the option ``VM_IMAGE_CREATE=true`` the system will reformat the disk image
# destroying anything that was it image previously.
VM_IMAGE_CREATE=${VM_IMAGE_CREATE:-true}
if [[ "${VM_IMAGE_CREATE}" = true ]]; then
qemu-img create -f qcow2 \
-o preallocation=metadata,compat=1.1,lazy_refcounts=on \
/var/lib/libvirt/images/${node%%":"*}.openstackci.local.img \
"${VM_DISK_SIZE}G"
fi
VM_NAME=$(virsh list --all --name | grep "${node%%":"*}" || echo "")
if [[ -z "${VM_NAME}" ]]; then
virsh define /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml || true
virsh create /etc/libvirt/qemu/${node%%":"*}.openstackci.local.xml || true
else
virsh start "${VM_NAME}"
fi
done
}
function write_osa_general_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
done
}
function write_osa_cinder_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
cat >> ${CONFD_FILE} <<EOF
container_vars:
cinder_backends:
limit_container_types: cinder_volume
lvm:
volume_group: cinder-volumes
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI
iscsi_ip_address: "${NETWORK_BASE}.236.${node#*":"}"
EOF
done
}
function write_osa_swift_proxy_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
cat >> ${CONFD_FILE} <<EOF
container_vars:
swift_proxy_vars:
limit_container_types: swift_proxy
read_affinity: "r1=100"
write_affinity: "r1"
write_affinity_node_count: "1 * replicas"
EOF
done
}
function write_osa_swift_storage_confd {
CONFD_FILE="/etc/openstack_deploy/conf.d/${1}.yml"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
echo "---" >> ${CONFD_FILE}
echo "$1:" >> ${CONFD_FILE}
for node in $(get_host_type ${2}); do
echo " ${node%%':'*}:" >> ${CONFD_FILE}
echo " ip: ${NETWORK_BASE}.236.${node#*":"}" >> ${CONFD_FILE}
cat >> ${CONFD_FILE} <<EOF
container_vars:
swift_vars:
limit_container_types: swift
zone: 0
region: 1
EOF
done
}
function osa_user_var_add {
if ! grep -q "^$1" /etc/openstack_deploy/user_variables.yml; then
echo "$2" | tee -a /etc/openstack_deploy/user_variables.yml
else
sed -i "s|$1.*|$2|g" /etc/openstack_deploy/user_variables.yml
fi
}
function ansible_static_inventory {
CONFD_FILE="$1"
echo "## DO NOT WRITE TO THIS FILE, CHANGES WILL BE LOST!" > ${CONFD_FILE}
for node_type in $(get_all_types); do
echo "[${node_type}]" >> ${CONFD_FILE}
for node in $(get_host_type ${node_type}); do
echo "10.0.0.${node#*":"}" >> ${CONFD_FILE}
done
done
}
function install_bits {
successerator openstack-ansible $@
}
function successerator {
set +e
# Get the time taht the method was started
OP_START_TIME=$(date +%s)
#Set the initial return value to failure.
false
for ((RETRY=0; $? != 0 && RETRY < MAX_RETRIES; RETRY++)); do
if [ ${RETRY} -gt 1 ]; then
$@ -vvvv
else
$@
fi
done
# If max retries were hit, fail.
if [ $? -ne 0 && [ ${RETRY} -eq ${MAX_RETRIES} ];then
echo -e "\n Hit maximum number of retries, giving up..\n"
exit
fi
# Print the time that the method completed.
OP_TOTAL_SECONDS="$(( $(date +%s) - OP_START_TIME ))"
REPORT_OUTPUT="${OP_TOTAL_SECONDS} seconds"
REPORT_DATA+="- Operation: [ $@ ]\t${REPORT_OUTPUT}\tNumber of Attempts [ ${RETRY} ]\n"
echo -e "Run Time = ${REPORT_OUTPUT}"
set -e
}
# Return 1 if the second argument is a substring of the first argument, otherwise return 0
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" == "$string"
then
echo 0 # $substring is not in $string
else
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())
haproxy_services = (x.get('haproxy_default_services')
or x.get('haproxy_service_configs'))
for i in haproxy_services:
y = i['service'].get('haproxy_port')
if isinstance(y, int):
print y
EOL
}

View File

@ -1,26 +0,0 @@
{
"infra": {
"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"
},
"deploy": {
"deploy1":"150"
}
}

View File

@ -1,175 +0,0 @@
#!/usr/bin/env bash
# Load service variables
source openrc
# bring in variable definitions if there is a variables.sh file
[[ -f variables.sh ]] && source variables.sh
# Provide defaults for unset variables
# Set first two octets of network used for containers, storage, etc
NETWORK_BASE=${NETWORK_BASE:-172.29}
# Create base flavors for the new deployment
for flavor in micro tiny mini small medium large xlarge heavy; do
NAME="m1.${flavor}"
ID="${ID:-0}"
RAM="${RAM:-256}"
DISK="${DISK:-1}"
VCPU="${VCPU:-1}"
SWAP="${SWAP:-0}"
EPHEMERAL="${EPHEMERAL:-0}"
nova flavor-delete $ID > /dev/null || echo "No Flavor with ID: [ $ID ] found to clean up"
nova flavor-create $NAME $ID $RAM $DISK $VCPU --swap $SWAP --is-public true --ephemeral $EPHEMERAL --rxtx-factor 1
let ID=ID+1
let RAM=RAM*2
if [ "$ID" -gt 5 ];then
let VCPU=VCPU*2
let DISK=DISK*2
let EPHEMERAL=256
let SWAP=4
elif [ "$ID" -gt 4 ];then
let VCPU=VCPU*2
let DISK=DISK*4+$DISK
let EPHEMERAL=$DISK/2
let SWAP=4
elif [ "$ID" -gt 3 ];then
let VCPU=VCPU*2
let DISK=DISK*4+$DISK
let EPHEMERAL=$DISK/3
let SWAP=4
elif [ "$ID" -gt 2 ];then
let VCPU=VCPU+$VCPU/2
let DISK=DISK*4
let EPHEMERAL=$DISK/3
let SWAP=4
elif [ "$ID" -gt 1 ];then
let VCPU=VCPU+1
let DISK=DISK*2+$DISK
fi
done
# Neutron provider network setup
neutron net-create GATEWAY_NET \
--router:external=True \
--provider:physical_network=flat \
--provider:network_type=flat
neutron subnet-create GATEWAY_NET ${NETWORK_BASE}.248.0/22 \
--name GATEWAY_NET_SUBNET \
--gateway ${NETWORK_BASE}.248.1 \
--allocation-pool start=${NETWORK_BASE}.248.201,end=${NETWORK_BASE}.248.255 \
--dns-nameservers list=true ${DNS_NAMESERVER}
# Neutron private network setup
neutron net-create PRIVATE_NET \
--shared \
--router:external=True \
--provider:network_type=vxlan \
--provider:segmentation_id 101
neutron subnet-create PRIVATE_NET 192.168.0.0/24 \
--name PRIVATE_NET_SUBNET
# Neutron router setup
ROUTER_ID=$(neutron router-create GATEWAY_NET_ROUTER | grep -w id | awk '{print $4}')
neutron router-gateway-set \
${ROUTER_ID} \
$(neutron net-list | awk '/GATEWAY_NET/ {print $2}')
neutron router-interface-add \
${ROUTER_ID} \
$(neutron subnet-list | awk '/PRIVATE_NET_SUBNET/ {print $2}')
# Neutron security group setup
for id in $(neutron security-group-list -f yaml | awk '/- id\:/ {print $3}'); do
# Allow ICMP
neutron security-group-rule-create --protocol icmp \
--direction ingress \
$id || true
# Allow all TCP
neutron security-group-rule-create --protocol tcp \
--port-range-min 1 \
--port-range-max 65535 \
--direction ingress \
$id || true
# Allow all UDP
neutron security-group-rule-create --protocol udp \
--port-range-min 1 \
--port-range-max 65535 -\
-direction ingress \
$id || true
done
# Create some default images
wget http://uec-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
glance image-create --name 'Ubuntu 14.04 LTS' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file ubuntu-14.04-server-cloudimg-amd64-disk1.img
rm ubuntu-14.04-server-cloudimg-amd64-disk1.img
wget http://uec-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
glance image-create --name 'Ubuntu 16.04' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file ubuntu-16.04-server-cloudimg-amd64-disk1.img
rm ubuntu-16.04-server-cloudimg-amd64-disk1.img
wget http://dfw.mirror.rackspace.com/fedora/releases/24/CloudImages/x86_64/images/Fedora-Cloud-Base-24-1.2.x86_64.qcow2
glance image-create --name 'Fedora 24' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file Fedora-Cloud-Base-24-1.2.x86_64.qcow2
rm Fedora-Cloud-Base-24-1.2.x86_64.qcow2
wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
glance image-create --name 'CentOS 7' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file CentOS-7-x86_64-GenericCloud.qcow2
rm CentOS-7-x86_64-GenericCloud.qcow2
wget http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64-0.0.4-Build2.12.qcow2
glance image-create --name 'OpenSuse Leap 42' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file openSUSE-Leap-42.1-OpenStack.x86_64-0.0.4-Build2.12.qcow2
rm openSUSE-Leap-42.1-OpenStack.x86_64-0.0.4-Build2.12.qcow2
wget http://cdimage.debian.org/cdimage/openstack/current/debian-8.6.0-openstack-amd64.qcow2
glance image-create --name 'Debian 8.6.0' \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file debian-8.6.0-openstack-amd64.qcow2
rm debian-8.6.0-openstack-amd64.qcow2
wget http://cdimage.debian.org/cdimage/openstack/testing/debian-testing-openstack-amd64.qcow2
glance image-create --name "Debian TESTING $(date +%m-%d-%y)" \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file debian-testing-openstack-amd64.qcow2
rm debian-testing-openstack-amd64.qcow2
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
glance image-create --name "Cirros-0.3.4" \
--container-format bare \
--disk-format qcow2 \
--visibility public \
--progress \
--file cirros-0.3.4-x86_64-disk.img
rm cirros-0.3.4-x86_64-disk.img

View File

@ -0,0 +1,71 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gather facts
hosts: dhcp_hosts
gather_facts: "{{ gather_facts | default(true) }}"
pre_tasks:
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}.yml"
tags:
- always
- name: Install all required packages for dhcpd_install
package:
pkg: "{{ item }}"
state: "latest"
update_cache: yes
cache_valid_time: 600
with_items: "{{ mnaio_dhcp_distro_packages }}"
- name: Enable services
service:
name: "{{ item }}"
enabled: yes
with_items: "{{ mnaio_dhcp_distro_packages }}"
tasks:
- name: Create a template in /etc/dhcp/dhcpd.conf
template:
src: dhcp/dhcpd.conf.j2
dest: /etc/dhcp/dhcpd.conf
mode: 0644
owner: root
group: root
notify: restart dhcpd
- name: Create a template in /etc/dhcp/dhcpd.conf
template:
src: dhcp/isc-dhcp-server
dest: /etc/default/isc-dhcp-server
mode: 0644
owner: root
group: root
notify: restart dhcpd
handlers:
- name: restart dhcpd
service:
name: "{{ item }}"
state: restarted
with_items: "{{ mnaio_dhcp_distro_packages }}"
vars_files:
- vars/main.yml
tags:
- deploy-dhcpd

View File

@ -0,0 +1,227 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in witing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Wait for deploy host
hosts: openstack_hosts
gather_facts: false
pre_tasks:
- name: Wait for container connectivity
wait_for_connection:
connect_timeout: 5
sleep: 10
timeout: 1200
tasks:
- name: copy host keys
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0600"
with_items:
- src: /root/.ssh/id_rsa
dest: /root/.ssh/id_rsa
- src: /root/.ssh/id_rsa.pub
dest: /root/.ssh/id_rsa.pub
- name: un-mount deleteme mount
mount:
name: "/deleteme"
state: unmounted
- name: remote deleteme mount
mount:
name: "/deleteme"
state: absent
- name: Remove deleteme dir
file:
path: "/deleteme"
state: absent
- name: Remove deleteme lv
lvol:
vg: vg00
lv: deleteme00
force: true
state: absent
- name: Setup cinder host volume
hosts: cinder_hosts
gather_facts: false
tasks:
- name: Create cinder-volumes lv
lvol:
vg: vg00
lv: cinder-volumes00
size: 100%FREE
shrink: false
- name: Create data cinder-volumes group
lvg:
vg: cinder-volumes
pvs: "/dev/vg00/cinder-volumes00"
- name: Setup cinder host volume
hosts: swift_hosts
gather_facts: false
tasks:
- name: Remove deleteme lv
lvol:
vg: vg00
lv: "{{ item }}"
size: 4G
with_items:
- disk1
- disk2
- disk3
- name: Format swift drives
filesystem:
fstype: xfs
dev: "/dev/vg00/{{ item }}"
with_items:
- disk1
- disk2
- disk3
- name: Create drive directories
file:
path: "/srv/{{ item }}"
state: directory
owner: "root"
group: "root"
mode: "0755"
with_items:
- disk1
- disk2
- disk3
- name: Mount swift drives
mount:
name: "/srv/{{ item }}"
src: "/dev/mapper/vg00-{{ item }}"
fstype: xfs
state: mounted
with_items:
- disk1
- disk2
- disk3
- name: Setup deploy host
hosts: deploy_hosts
gather_facts: "{{ gather_facts | default(true) }}"
pre_tasks:
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}.yml"
tags:
- always
tasks:
# Example read-write git checkout from github
- name: Get OSA
git:
repo: https://git.openstack.org/openstack/openstack-ansible
dest: /opt/openstack-ansible
version: "{{ osa_branch | default('master') }}"
when:
- pre_config_osa | default(true) | bool
- name: Create Basic configs
shell: cp -R etc/openstack_deploy/* /etc/openstack_deploy
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Create base directories
file:
path: "{{ item }}"
state: directory
owner: "root"
group: "root"
mode: "0755"
with_items:
- /etc/openstack_deploy
- /etc/openstack_deploy/conf.d
- /etc/openstack_deploy/env.d
when:
- pre_config_osa | default(true) | bool
- name: Drop osa config
template:
src: "osa/openstack_user_config.yml"
dest: /etc/openstack_deploy/openstack_user_config.yml
mode: "0644"
owner: root
group: root
when:
- pre_config_osa | default(true) | bool
- name: Drop osa user variables
template:
src: "osa/user_mnaio_variables.yml"
dest: /etc/openstack_deploy/user_mnaio_variables.yml
mode: "0644"
owner: root
group: root
when:
- pre_config_osa | default(true) | bool
- name: Bootstrap ansible
command: bash ./scripts/bootstrap-ansible.sh
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Get pip2 and pw gen deps
command: python2 /opt/get-pip.py pycrypto pyyaml
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Create passwords
command: python2 ./scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Run OSA
command: "{{ item }}"
args:
chdir: /opt/openstack-ansible/playbooks
with_items:
- tmux new-session -d -s build-osa
- tmux select-pane -t 0
- tmux send-keys "ulimit -n 10240" C-m
- tmux send-keys "openstack-ansible setup-everything.yml" C-m
when:
- run_osa | default(true) | bool
- name: Finished notice
debug:
msg: |
OSA deploy running. To check on the state of this deployment, login
to the deploy1 VM and attach to the "build-osa" tmux session.
when:
- run_osa | default(true) | bool

View File

@ -0,0 +1,296 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in witing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gather facts
hosts: pxe_hosts
gather_facts: "{{ gather_facts | default(true) }}"
pre_tasks:
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}.yml"
tags:
- always
- name: Install host distro packages
package:
pkg: "{{ item }}"
state: "latest"
update_cache: yes
cache_valid_time: 600
with_items: "{{ mnaio_pxe_distro_packages }}"
- name: Create base directories
file:
path: "{{ item }}"
state: directory
owner: "root"
group: "root"
mode: "0755"
with_items:
- /var/www/pxe
- /var/www/pxe/images
- /var/www/pxe/iso
- /var/www/pxe/networking
- /var/www/pxe/scripts
- /var/www/pxe/templates
- /var/lib/tftpboot
- /var/lib/tftpboot/boot-screens
- /var/lib/tftpboot/preseed
- /var/lib/tftpboot/pxelinux.cfg
- name: Get root public key
command: cat /root/.ssh/id_rsa.pub
register: public_key_get
changed_when: false
- name: Set key facts
set_fact:
tftp_ssh_key: "{{ public_key_get.stdout }}"
tasks:
- name: Drop NGINX config
copy:
src: "pxe/sites-enabled.default"
dest: /etc/nginx/sites-enabled/default
mode: "0644"
owner: root
group: root
notify:
- restart nginx
- name: Drop tftp-hpa configs
copy:
src: "pxe/tftp/tftp-hpa"
dest: /etc/default/tftpd-hpa
mode: "0644"
owner: root
group: root
notify:
- restart tftp-hpa
- name: Drop inetd configs
copy:
src: "pxe/tftp/inetd.conf"
dest: /etc/default/tftpd-hpa
mode: "0644"
owner: root
group: root
notify:
- restart tftp-hpa
- name: Download image iso(s)
get_url:
url: "{{ item.value.image_iso_url }}"
dest: "/var/www/pxe/iso/{{ item.value.image_name }}"
with_dict: "{{ images }}"
- name: Remove image directory if it exists
file:
path: "/var/www/pxe/images/{{ item.value.image_short_name }}"
state: absent
with_dict: "{{ images }}"
- name: Create image directory if it exists
file:
path: "/var/www/pxe/images/{{ item.value.image_short_name }}"
state: directory
owner: "root"
group: "root"
mode: "0755"
with_dict: "{{ images }}"
- name: Extract ISO(s) contents
command: "7z x /var/www/pxe/iso/{{ item.value.image_name }}"
args:
chdir: "/var/www/pxe/images/{{ item.value.image_short_name }}"
with_dict: "{{ images }}"
- name: Download pxelinux
get_url:
url: "{{ pxelinux_url }}"
dest: "/var/www/pxe/{{ pxelinux_name }}"
tmp_dest: /tmp/
- name: Remove image directory if it exists
file:
path: "/var/www/pxe/{{ pxelinux_short_name }}"
state: absent
- name: Extract pxelinux contents
command: "tar -xf /var/www/pxe/{{ pxelinux_name }}"
args:
chdir: "/var/www/pxe"
- name: Drop pxelinux.cfg default menu
copy:
src: "pxe/tftp/pxelinux.cfg.default"
dest: "{{ item }}"
mode: "0644"
owner: root
group: root
with_items:
- /var/lib/tftpboot/pxelinux.cfg/default
- /var/lib/tftpboot/boot-screens/syslinux.cfg
# These links are using the shell command because the file module does not create hard links
- name: Create hard links
shell: |
ln -f /var/www/pxe/{{ pxelinux_short_name }}/bios/com32/elflink/ldlinux/ldlinux.c32 /var/lib/tftpboot/ldlinux.c32
ln -f /var/www/pxe/{{ pxelinux_short_name }}/bios/core/pxelinux.0 /var/lib/tftpboot/pxelinux.0
ln -f /var/www/pxe/{{ pxelinux_short_name }}/bios/com32/lib/libcom32.c32 /var/lib/tftpboot/boot-screens/libcom32.c32
ln -f /var/www/pxe/{{ pxelinux_short_name }}/bios/com32/libutil/libutil.c32 /var/lib/tftpboot/boot-screens/libutil.c32
ln -f /var/www/pxe/{{ pxelinux_short_name }}/bios/com32/menu/vesamenu.c32 /var/lib/tftpboot/boot-screens/vesamenu.c32
- name: Drop boot-screens default menu
template:
src: "pxe/tftp/menu.cfg.j2"
dest: /var/lib/tftpboot/boot-screens/menu.cfg
mode: "0644"
owner: root
group: root
tags:
- boot-menu
- name: Drop tftp-hpa configs
template:
src: "pxe/tftp/tftp-hpa"
dest: /etc/default/tftpd-hpa
mode: "0644"
owner: root
group: root
notify:
- restart tftp-hpa
- name: network scripts for pxe
template:
src: "pxe/{{ ansible_os_family | lower }}/{{ item.src }}"
dest: /var/www/pxe/{{ item.dir }}/{{ item.dest }}
mode: "0644"
owner: root
group: root
with_items:
- src: basic-interface.cfg
dest: basic-interface.cfg
dir: networking
- src: mnaio-bridges.cfg.j2
dest: mnaio-bridges.cfg
dir: networking
- src: mnaio-post-install-script.sh.j2
dest: mnaio-post-install-script.sh
dir: scripts
- src: vm-post-install-script.sh.j2
dest: vm-post-install-script.sh
dir: scripts
- name: network scripts for servers
template:
src: "pxe/{{ ansible_os_family | lower }}/vm-bridges.cfg.j2"
dest: /var/www/pxe/networking/{{ item.server_hostname }}-bridges.cfg
mode: "0644"
owner: root
group: root
with_items: "{{ servers }}"
- name: tftp configs for servers
template:
src: "pxe/tftp/pxelinux.cfg.macaddr.j2"
dest: "/var/lib/tftpboot/pxelinux.cfg/01-{{ item.server_mac_address | replace(':', '-') }}"
mode: "0644"
owner: root
group: root
with_items: "{{ servers }}"
- name: Preseeds for pxe mnaio
template:
src: "pxe/{{ ansible_os_family | lower }}/mnaio.preseed.j2"
dest: /var/lib/tftpboot/preseed/mnaio.preseed
mode: "0644"
owner: root
group: root
with_dict: "{{ images }}"
- name: Preseeds for pxe vm
template:
src: "pxe/{{ ansible_os_family | lower }}/vm.preseed.j2"
dest: /var/lib/tftpboot/preseed/vm.preseed
mode: "0644"
owner: root
group: root
with_dict: "{{ images }}"
- name: Create netboot bind mount path
file:
path: "/var/lib/tftpboot/{{ item.value.image_short_name }}"
state: directory
owner: "root"
group: "root"
mode: "0755"
with_dict: "{{ images }}"
- name: Unbind mount netboot images
mount:
name: "/var/lib/tftpboot/{{ item.value.image_short_name }}"
src: "/var/www/pxe/images/{{ item.value.image_netboot }}"
opts: bind
fstype: none
state: unmounted
register: fstab
with_dict: "{{ images }}"
- name: Ensure permissions are correct
shell: |
# Fix perms if needed
find /var/lib/tftpboot -type d -exec chmod 0755 {} \;
find /var/lib/tftpboot -type f -exec chmod 0644 {} \;
find /var/www/pxe -type d -exec chmod 0755 {} \;
- name: Bind mount netboot images
mount:
name: "/var/lib/tftpboot/{{ item.value.image_short_name }}"
src: "/var/www/pxe/images/{{ item.value.image_netboot }}"
opts: bind
fstype: none
state: mounted
register: fstab
with_dict: "{{ images }}"
handlers:
- name: restart nginx
service:
name: "nginx"
state: restarted
enabled: yes
- name: restart tftp-hpa
service:
name: "tftpd-hpa"
state: restarted
enabled: yes
- name: restart inetd
service:
name: "inetutils-inetd"
state: restarted
enabled: yes
vars_files:
- vars/main.yml
tags:
- deploy-pxe

View File

@ -0,0 +1,66 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in witing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gather facts
hosts: vm_hosts
gather_facts: "{{ gather_facts | default(true) }}"
pre_tasks:
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}.yml"
tags:
- always
tasks:
- name: Create VM LV
lvol:
vg: vg01
lv: "{{ item.server_hostname }}"
size: "{{ default_vm_storage }}"
with_items: "{{ servers }}"
- name: Create the VM template
template:
src: kvm/kvm-vm.xml
dest: "/etc/libvirt/qemu/{{ item.server_hostname }}.xml"
mode: 0644
owner: root
group: root
with_items: "{{ servers }}"
- name: Define the VM
command: "virsh define /etc/libvirt/qemu/{{ item.server_hostname }}.xml"
failed_when: false
with_items: "{{ servers }}"
- name: Create the VM
command: "virsh create /etc/libvirt/qemu/{{ item.server_hostname }}.xml"
failed_when: false
with_items: "{{ servers }}"
- name: Start the VM
command: "virsh start {{ item.server_hostname }}"
failed_when: false
with_items: "{{ servers }}"
vars_files:
- vars/main.yml
tags:
- setup-host

View File

@ -1,6 +1,3 @@
#jinja2: lstrip_blocks: True
### MANAGED BY {{ role_path|basename }} ANSIBLE ROLE ###
ddns-update-style none;
allow booting;
@ -39,15 +36,15 @@ shared-network all-networks {
{% endfor %}
{% if server_list.0.name != "blank" %}
group {
{% for host in server_list %}
host {{ host.name }} {
hardware ethernet {{ host.hwaddr }};
fixed-address {{ host.ip }};
option host-name "{{ host.name }}";
{% for item in servers %}
host {{ item.server_hostname }} {
hardware ethernet {{ item.server_mac_address }};
fixed-address {{ item.server_vm_fixed_addr }};
option host-name "{{ item.server_hostname }}";
}
{% endfor %}
}
{% endif %}
}

View File

@ -0,0 +1 @@
INTERFACES="vm-br-dhcp"

View File

@ -0,0 +1,51 @@
[all]
localhost ansible_connection=local
mnaio1 ansible_host=10.0.2.1
infra1 ansible_host=10.0.236.100
infra2 ansible_host=10.0.236.101
infra3 ansible_host=10.0.236.102
log1 ansible_host=10.0.236.103
compute1 ansible_host=10.0.236.105
compute2 ansible_host=10.0.236.106
cinder1 ansible_host=10.0.236.107
cinder2 ansible_host=10.0.236.108
swift1 ansible_host=10.0.236.109
swift2 ansible_host=10.0.236.110
swift3 ansible_host=10.0.236.111
deploy1 ansible_host=10.0.236.112
[pxe_hosts]
mnaio1
[dhcp_hosts]
mnaio1
[vm_hosts]
mnaio1
[deploy_hosts]
deploy1
[swift_hosts]
swift1
swift2
swift3
[cinder_hosts]
cinder1
cinder2
[openstack_hosts]
infra1
infra2
infra3
log1
compute1
compute2
cinder2
cinder1
swift1
swift2
swift3
deploy1

View File

@ -0,0 +1,99 @@
<domain type='kvm'>
<name>{{ item.server_hostname }}</name>
<memory unit='MiB'>{{ item.server_vm_ram }}</memory>
<currentMemory unit='MiB'>{{ item.server_vm_ram }}</currentMemory>
<vcpu placement='static' current='1'>{{ item.server_vm_vcpus }}</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-{{ ansible_distribution_release | lower }}'>hvm</type>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
<apic/>
</features>
<cpu mode='host-model'>
<model fallback='allow'/>
<topology sockets='1' cores='{{ item.server_vm_vcpus }}' threads='1'/>
</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>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/vg01/{{ item.server_hostname }}'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
<boot order='1'/>
</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='0x0a' function='0x0'/>
</controller>
{% for _key, _value in item.server_networks.items()|sort(attribute='1.iface') %}
<interface type='network'>
{% if _key == item.server_vm_primary_network %}
<mac address='{{ item.server_mac_address }}'/>
<boot order='2'/>
{% endif %}
<source network='{{ _value.vm_int_iface }}'/>
<model type='virtio'/>
</interface>
{% endfor %}
<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='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
<alias name='rng0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
</rng>
</devices>
</domain>

View File

@ -0,0 +1,5 @@
<network>
<name>{{ item.value.iface }}</name>
<forward mode="bridge"/>
<bridge name="{{ item.value.iface }}"/>
</network>

View File

@ -0,0 +1,206 @@
---
cidr_networks:
container: 10.0.236.0/22
tunnel: 10.0.240.0/22
storage: 10.0.244.0/22
flat: 10.0.248.0/22
used_ips:
- "10.0.236.0,10.0.236.200"
- "10.0.240.0,10.0.240.200"
- "10.0.244.0,10.0.244.200"
- "10.0.248.0,10.0.248.200"
global_overrides:
internal_lb_vip_address: "10.0.236.112"
external_lb_vip_address: "10.0.2.150"
tunnel_bridge: "br-vxlan"
management_bridge: "br-mgmt"
provider_networks:
- network:
container_bridge: "br-mgmt"
container_type: "veth"
container_interface: "eth1"
ip_from_q: "container"
type: "raw"
group_binds:
- all_containers
- hosts
is_container_address: true
is_ssh_address: true
- network:
container_bridge: "br-vxlan"
container_type: "veth"
container_interface: "eth10"
ip_from_q: "tunnel"
type: "vxlan"
range: "1:1000"
net_name: "vxlan"
group_binds:
- neutron_linuxbridge_agent
- network:
container_bridge: "br-flat"
container_type: "veth"
container_interface: "eth12"
type: "flat"
net_name: "flat"
group_binds:
- neutron_linuxbridge_agent
- utility_all
- network:
container_bridge: "br-vlan"
container_type: "veth"
container_interface: "eth11"
type: "vlan"
range: "1:1"
net_name: "vlan"
group_binds:
- neutron_linuxbridge_agent
- network:
container_bridge: "br-storage"
container_type: "veth"
container_interface: "eth2"
ip_from_q: "storage"
type: "raw"
group_binds:
- glance_api
- cinder_api
- cinder_volume
- nova_compute
- swift_proxy
swift:
part_power: 8
storage_network: 'br-storage'
replication_network: 'br-storage'
drives:
- name: disk1
- name: disk2
- name: disk3
mount_point: /srv
storage_policies:
- policy:
name: default
index: 0
default: True
###
### Anchors
###
infra_block: &infra_block
infra1:
ip: 10.0.236.100
infra2:
ip: 10.0.236.101
infra3:
ip: 10.0.236.102
compute_block: &compute_block
compute1:
ip: 10.0.236.105
compute2:
ip: 10.0.236.106
cinder_block: &cinder_block
cinder1:
ip: 10.0.236.107
container_vars:
cinder_backends:
limit_container_types: cinder_volume
lvm:
volume_group: cinder-volumes
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI
iscsi_ip_address: "10.0.244.107"
cinder2:
ip: 10.0.236.108
container_vars:
cinder_backends:
limit_container_types: cinder_volume
lvm:
volume_group: cinder-volumes
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI
iscsi_ip_address: "10.0.244.108"
swift_block: &swift_block
swift1:
ip: 10.0.236.109
swift1:
ip: 10.0.236.110
swift1:
ip: 10.0.236.111
###
### Infrastructure
###
# galera, memcache, rabbitmq, utility
shared-infra_hosts: *infra_block
# repository (apt cache, python packages, etc)
repo-infra_hosts: *infra_block
# rsyslog server
log_hosts:
log1:
ip: 10.0.236.103
# load balancer
haproxy_hosts:
deploy1:
ip: 10.0.236.112
###
### OpenStack
###
# keystone
identity_hosts: *infra_block
# cinder api services
storage-infra_hosts: *infra_block
# glance
image_hosts: *infra_block
# nova api, conductor, etc services
compute-infra_hosts: *infra_block
# heat
orchestration_hosts: *infra_block
# horizon
dashboard_hosts: *infra_block
# neutron server, agents (L3, etc)
network_hosts: *infra_block
# ceilometer (telemetry data collection)
metering-infra_hosts: *infra_block
# aodh (telemetry alarm service)
metering-alarm_hosts: *infra_block
# gnocchi (telemetry metrics storage)
metrics_hosts: *infra_block
# ceilometer compute agent (telemetry data collection)
metering-compute_hosts: *compute_block
# nova hypervisors
compute_hosts: *compute_block
# cinder storage host (LVM-backed)
storage_hosts: *cinder_block
# swift storage hosts
swift_hosts: *swift_block
# swift infra hosts
swift-proxy_hosts: *infra_block

View File

@ -0,0 +1,30 @@
---
lxc_container_backing_store: dir
# Tempest is being configured to use a known network
tempest_public_subnet_cidr: 10.0.248.0/26
# This makes running neutron in a distributed system easier and a lot less noisy
neutron_l2_population: True
# This makes the glance image store use swift instead of the file backend
glance_default_store: swift
{% if http_proxy is defined and http_proxy %}
proxy_env_url: "{{ http_proxy }}"
{% raw %}
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 %}"
global_environment_variables:
HTTP_PROXY: "{{ proxy_env_url }}"
HTTPS_PROXY: "{{ proxy_env_url }}"
NO_PROXY: "{{ no_proxy_env }}"
http_proxy: "{{ proxy_env_url }}"
https_proxy: "{{ proxy_env_url }}"
no_proxy: "{{ no_proxy_env }}"
{% endraw %}
glance_glance_api_conf_overrides:
glance_store:
http_proxy_information: "http:http://, https:http://"
{% endif %}

View File

@ -0,0 +1,7 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
source /etc/network/interfaces.d/*.cfg

View File

@ -0,0 +1,19 @@
# Physical interface, could be bond. This only needs to be set once
{% for key, value in mnaio_host_networks.items() %}
{% if value.iface_port != 'none' %}
auto {{ value.iface_port }}
iface {{ value.iface_port }} inet manual
{% endif %}
auto {{ value.iface }}
iface {{ value.iface }} inet {{ value.inet_type }}
bridge_stp off
bridge_waitport {{ value.iface_port == 'none' | ternary('0', '10') }}
bridge_fd 0
bridge_ports {{ value.iface_port }}
offload-sg off
{% if value.address is defined %}
address {{ value.address }}
{% endif %}
{% endfor %}

View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
apt-get remove --purge snap* lxc* lxd* || true
sed -i 's/\(GRUB_CMDLINE_LINUX_DEFAULT=\).*/\1\"\"/g' /target/etc/default/grub
update-grub
sed -i '/PermitRootLogin / s/ .*/ yes/' /etc/ssh/sshd_config
mkdir -p /root/.ssh
chmod 0700 /root/.ssh
echo "{{ tftp_ssh_key }}" >> /root/.ssh/authorized_keys
wget {{ tftp_server }}/networking/mnaio-bridges.cfg -O /etc/network/interfaces.d/mnaio-bridges.cfg
wget {{ tftp_server }}/networking/basic-interface.cfg -O /etc/network/interfaces

Some files were not shown because too many files have changed in this diff Show More