Merge role baremetal-prep-overcloud
This commit is contained in:
commit
c1b13df684
|
@ -0,0 +1,50 @@
|
|||
Role Name
|
||||
=========
|
||||
|
||||
An Ansible role to setup the undercloud for a deployment on baremetal overcloud nodes.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
This playbook expects that the undercloud has been installed and setup using one of the roles relevant to baremetal overcloud deployments.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html).
|
||||
|
||||
- step_root_device_size: <false> -- boolean value that will apply disk size hints and rerun introspection if true
|
||||
- working_dir: <'/home/stack'> -- working directory for the role. Assumes stackrc file is present at this location
|
||||
- step_adjust_mtu: <false> -- boolean value that will change MTUS on specified nics
|
||||
- mtu: <1350> -- numerical value to set MTUs
|
||||
- mtu_interface: <'eth1'> -- list of NICs
|
||||
- undercloud_type: <virtual> -- can be overwritten with values like 'baremetal' or 'ovb'
|
||||
- network_isolation: <true> -- bolean value to test if network isolation wil be used in the deployment
|
||||
- network_isolation_ipv4_cidr: <"172.16.23.0/24">
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
This playbook does not deploy the overcloud. After this playbook runs, call https://github.com/redhat-openstack/ansible-role-tripleo-overcloud.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
1. Sample playbook to call the role
|
||||
|
||||
- name: Prepare for deployment on baremetal overcloud
|
||||
hosts: virthost
|
||||
gather_facts: no
|
||||
roles:
|
||||
- ansible-role-tripleo-overcloud-prep-baremetal
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Apache
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
RDO-CI Team
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
working_dir: /home/stack
|
||||
|
||||
step_install_upstream_ipxe: false
|
||||
|
||||
step_adjust_mtu: false
|
||||
mtu: 1350
|
||||
mtu_interface:
|
||||
- eth1
|
||||
|
||||
undercloud_type: virtual
|
||||
network_isolation: true
|
||||
network_isolation_ipv4_cidr: "172.16.23.0/24"
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
# handlers file for ansible-role-tripleo-baremetal-overcloud
|
|
@ -0,0 +1,173 @@
|
|||
galaxy_info:
|
||||
author: your name
|
||||
description:
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Some suggested licenses:
|
||||
# - BSD (default)
|
||||
# - MIT
|
||||
# - GPLv2
|
||||
# - GPLv3
|
||||
# - Apache
|
||||
# - CC-BY
|
||||
license: license (GPLv2, CC-BY, etc)
|
||||
|
||||
min_ansible_version: 1.2
|
||||
|
||||
# Optionally specify the branch Galaxy will use when accessing the GitHub
|
||||
# repo for this role. During role install, if no tags are available,
|
||||
# Galaxy will use this branch. During import Galaxy will access files on
|
||||
# this branch. If travis integration is cofigured, only notification for this
|
||||
# branch will be accepted. Otherwise, in all cases, the repo's default branch
|
||||
# (usually master) will be used.
|
||||
#github_branch:
|
||||
|
||||
#
|
||||
# Below are all platforms currently available. Just uncomment
|
||||
# the ones that apply to your role. If you don't see your
|
||||
# platform on this list, let us know and we'll get it added!
|
||||
#
|
||||
#platforms:
|
||||
#- name: EL
|
||||
# versions:
|
||||
# - all
|
||||
# - 5
|
||||
# - 6
|
||||
# - 7
|
||||
#- name: GenericUNIX
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: Solaris
|
||||
# versions:
|
||||
# - all
|
||||
# - 10
|
||||
# - 11.0
|
||||
# - 11.1
|
||||
# - 11.2
|
||||
# - 11.3
|
||||
#- name: Fedora
|
||||
# versions:
|
||||
# - all
|
||||
# - 16
|
||||
# - 17
|
||||
# - 18
|
||||
# - 19
|
||||
# - 20
|
||||
# - 21
|
||||
# - 22
|
||||
# - 23
|
||||
#- name: opensuse
|
||||
# versions:
|
||||
# - all
|
||||
# - 12.1
|
||||
# - 12.2
|
||||
# - 12.3
|
||||
# - 13.1
|
||||
# - 13.2
|
||||
#- name: IOS
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: SmartOS
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: eos
|
||||
# versions:
|
||||
# - all
|
||||
# - Any
|
||||
#- name: Windows
|
||||
# versions:
|
||||
# - all
|
||||
# - 2012R2
|
||||
#- name: Amazon
|
||||
# versions:
|
||||
# - all
|
||||
# - 2013.03
|
||||
# - 2013.09
|
||||
#- name: GenericBSD
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: Junos
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: FreeBSD
|
||||
# versions:
|
||||
# - all
|
||||
# - 10.0
|
||||
# - 10.1
|
||||
# - 10.2
|
||||
# - 8.0
|
||||
# - 8.1
|
||||
# - 8.2
|
||||
# - 8.3
|
||||
# - 8.4
|
||||
# - 9.0
|
||||
# - 9.1
|
||||
# - 9.1
|
||||
# - 9.2
|
||||
# - 9.3
|
||||
#- name: Ubuntu
|
||||
# versions:
|
||||
# - all
|
||||
# - lucid
|
||||
# - maverick
|
||||
# - natty
|
||||
# - oneiric
|
||||
# - precise
|
||||
# - quantal
|
||||
# - raring
|
||||
# - saucy
|
||||
# - trusty
|
||||
# - utopic
|
||||
# - vivid
|
||||
# - wily
|
||||
# - xenial
|
||||
#- name: SLES
|
||||
# versions:
|
||||
# - all
|
||||
# - 10SP3
|
||||
# - 10SP4
|
||||
# - 11
|
||||
# - 11SP1
|
||||
# - 11SP2
|
||||
# - 11SP3
|
||||
#- name: GenericLinux
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: NXOS
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
#- name: Debian
|
||||
# versions:
|
||||
# - all
|
||||
# - etch
|
||||
# - jessie
|
||||
# - lenny
|
||||
# - sid
|
||||
# - squeeze
|
||||
# - stretch
|
||||
# - wheezy
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is
|
||||
# a keyword that describes and categorizes the role.
|
||||
# Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of
|
||||
# alphanumeric characters. Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line.
|
||||
# Be sure to remove the '[]' above if you add dependencies
|
||||
# to this list.
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
|
||||
- name: Copy over adjust interface mtus script template
|
||||
template:
|
||||
src: adjust-interface-mtus.sh.j2
|
||||
dest: "{{ working_dir }}/adjust-interface-mtus.sh"
|
||||
mode: 0755
|
||||
|
||||
- name: Adjust MTU values and modify dnsmasq-ironic.conf
|
||||
become: yes
|
||||
shell: >
|
||||
"{{ working_dir }}"/adjust-interface-mtus.sh
|
||||
when: step_adjust_mtu
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
|
||||
- name: Copy over allow traffic script template
|
||||
template:
|
||||
src: allow-traffic-for-controller.sh.j2
|
||||
dest: "{{ working_dir }}/allow-traffic-for-controller.sh"
|
||||
mode: 0755
|
||||
|
||||
- name: Allow traffic for the controller
|
||||
become: yes
|
||||
shell: >
|
||||
"{{ working_dir }}"/allow-traffic-for-controller.sh
|
||||
when: network_isolation and undercloud_type == "baremetal"
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
|
||||
- name: Copy install upstream ipxe script template
|
||||
template:
|
||||
src: install-upstream-ipxe.sh.j2
|
||||
dest: "{{ working_dir }}/install-upstream-ipxe.sh"
|
||||
mode: 0755
|
||||
|
||||
- name: Run install upstream ipxe script
|
||||
shell: >
|
||||
"{{ working_dir }}"/install-upstream-ipxe.sh
|
||||
when: step_install_upstream_ipxe
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- include: adjust-mtu-dnsmasq-ironic.yml
|
||||
|
||||
- include: allow-traffic-for-controller.yml
|
||||
|
||||
- include: install-upstream-ipxe.yml
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
### --start_docs
|
||||
|
||||
## Adjust interface MTU valuesfor undercloud and overcloud
|
||||
## =======================================================
|
||||
|
||||
## * Adjust interface mtus
|
||||
## ::
|
||||
|
||||
{% for interface in (mtu_interface) %}
|
||||
ip link set {{ interface }} mtu {{ mtu }}
|
||||
echo "MTU={{ mtu }}" >> /etc/sysconfig/network-scripts/ifcfg-{{ interface }}
|
||||
{% endfor %}
|
||||
|
||||
## * Modify dnsmasq-ironic.conf
|
||||
## ::
|
||||
|
||||
echo -e "\ndhcp-option-force=26,{{ mtu }}" >> /etc/dnsmasq-ironic.conf
|
||||
systemctl restart 'neutron-*'
|
||||
systemctl restart openstack-ironic-conductor
|
||||
|
||||
### --stop_docs
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
### --start_docs
|
||||
|
||||
## Add traffic for controller on baremetal undercloud
|
||||
## ==================================================
|
||||
|
||||
## * Modify iptables
|
||||
## ::
|
||||
|
||||
iptables -A BOOTSTACK_MASQ -s {{ network_isolation_ipv4_cidr }} ! -d {{ network_isolation_ipv4_cidr }} -j MASQUERADE -t nat
|
||||
iptables-save > /etc/sysconfig/iptables
|
||||
|
||||
### --stop_docs
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script to install the ipxe upstream version
|
||||
|
||||
set -eux
|
||||
|
||||
### --start_docs
|
||||
|
||||
## Use
|
||||
## ===================
|
||||
|
||||
##.. note:: it may be necessary to install the upstream version of ipxe, to avoid this kind of problems:
|
||||
## <https://bugzilla.redhat.com/show_bug.cgi?id=1324422>
|
||||
|
||||
## * Install package dependencies
|
||||
## ::
|
||||
sudo yum -y install xz-devel
|
||||
|
||||
## * Clone upstream repo
|
||||
## ::
|
||||
git clone git://git.ipxe.org/ipxe.git /tmp/ipxe
|
||||
|
||||
## * Compile and replace undionly.kpxe
|
||||
## ::
|
||||
pushd /tmp/ipxe/src
|
||||
make
|
||||
sudo cp /tmp/ipxe/src/bin/undionly.kpxe /tftpboot/undionly.kpxe
|
||||
popd
|
||||
|
||||
### --stop_docs
|
|
@ -0,0 +1 @@
|
|||
localhost
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- ansible-role-tripleo-baremetal-overcloud
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
# vars file for ansible-role-tripleo-baremetal-overcloud
|
Loading…
Reference in New Issue