From cfc76ded4a1ede24158c15b9164273fe239b07f9 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 31 Jul 2017 20:21:24 -0500 Subject: [PATCH] Convert vars in files to host_vars This change allows the MNAIO to really be used as a stand alone kick system which has the potential to be developed into a stand alone project. At the very least this change improves playbook performance by scoping variables. The inventory has been converted into a typical Ansible inventory and the "servers" used in the MNAIO are now simply host_vars which will trigger specific VM builds when instructed to do so. This gives the MNAIO the ability to serve as a stand alone kick system which could be used for physical hosts as well as MNAIO testing all through the same basic set of playbooks. Should a deployer want to use this with physical servers they'd need to do nothing more than define their basic inventory and where the the required pieces of infrastructure needed to PXE boot their machines. Change-Id: I6c47e02ecfbe8ee7533e77b11041785db485a1a9 Signed-off-by: Kevin Carter --- multi-node-aio/README.rst | 4 +- multi-node-aio/playbooks/deploy-dhcp.yml | 2 - multi-node-aio/playbooks/deploy-osa.yml | 98 --- multi-node-aio/playbooks/deploy-pxe.yml | 29 +- multi-node-aio/playbooks/deploy-vms.yml | 150 ++++- multi-node-aio/playbooks/dhcp/dhcpd.conf.j2 | 10 +- multi-node-aio/playbooks/group_vars/all.yml | 66 ++ .../playbooks/group_vars/dhcp_hosts.yml | 28 + .../playbooks/group_vars/mnaio_hosts.yml | 83 +++ .../playbooks/group_vars/pxe_hosts.yml | 16 + .../playbooks/host_vars/cinder1.yml | 58 ++ .../playbooks/host_vars/cinder2.yml | 58 ++ .../playbooks/host_vars/compute1.yml | 58 ++ .../playbooks/host_vars/compute2.yml | 58 ++ .../host_vars/example-host1.yml.example | 58 ++ multi-node-aio/playbooks/host_vars/infra1.yml | 58 ++ multi-node-aio/playbooks/host_vars/infra2.yml | 58 ++ multi-node-aio/playbooks/host_vars/infra3.yml | 58 ++ .../playbooks/host_vars/loadbalancer1.yml | 58 ++ .../playbooks/host_vars/logging1.yml | 58 ++ multi-node-aio/playbooks/host_vars/swift1.yml | 58 ++ multi-node-aio/playbooks/host_vars/swift2.yml | 58 ++ multi-node-aio/playbooks/host_vars/swift3.yml | 58 ++ multi-node-aio/playbooks/inventory | 96 ++- multi-node-aio/playbooks/kvm/kvm-vm.xml | 22 +- .../debian/mnaio-bridges.cfg.j2 | 0 .../debian/mnaio-post-install-script.sh.j2 | 2 +- .../playbooks/osa/openstack_user_config.yml | 2 +- .../playbooks/pxe/debian/basic-interface.cfg | 2 +- .../playbooks/pxe/debian/vm-bridges.cfg.j2 | 5 +- .../pxe/debian/vm-post-install-script.sh.j2 | 2 +- .../playbooks/pxe/debian/vm.preseed.j2 | 2 +- .../pxe/tftp/pxelinux.cfg.macaddr.j2 | 6 +- multi-node-aio/playbooks/setup-host.yml | 6 +- multi-node-aio/playbooks/vars/main.yml | 631 ------------------ 35 files changed, 1191 insertions(+), 825 deletions(-) create mode 100644 multi-node-aio/playbooks/group_vars/all.yml create mode 100644 multi-node-aio/playbooks/group_vars/dhcp_hosts.yml create mode 100644 multi-node-aio/playbooks/group_vars/mnaio_hosts.yml create mode 100644 multi-node-aio/playbooks/group_vars/pxe_hosts.yml create mode 100644 multi-node-aio/playbooks/host_vars/cinder1.yml create mode 100644 multi-node-aio/playbooks/host_vars/cinder2.yml create mode 100644 multi-node-aio/playbooks/host_vars/compute1.yml create mode 100644 multi-node-aio/playbooks/host_vars/compute2.yml create mode 100644 multi-node-aio/playbooks/host_vars/example-host1.yml.example create mode 100644 multi-node-aio/playbooks/host_vars/infra1.yml create mode 100644 multi-node-aio/playbooks/host_vars/infra2.yml create mode 100644 multi-node-aio/playbooks/host_vars/infra3.yml create mode 100644 multi-node-aio/playbooks/host_vars/loadbalancer1.yml create mode 100644 multi-node-aio/playbooks/host_vars/logging1.yml create mode 100644 multi-node-aio/playbooks/host_vars/swift1.yml create mode 100644 multi-node-aio/playbooks/host_vars/swift2.yml create mode 100644 multi-node-aio/playbooks/host_vars/swift3.yml rename multi-node-aio/playbooks/{pxe => mnaio}/debian/mnaio-bridges.cfg.j2 (100%) rename multi-node-aio/playbooks/{pxe => mnaio}/debian/mnaio-post-install-script.sh.j2 (80%) delete mode 100644 multi-node-aio/playbooks/vars/main.yml diff --git a/multi-node-aio/README.rst b/multi-node-aio/README.rst index be90edae..175eed1c 100644 --- a/multi-node-aio/README.rst +++ b/multi-node-aio/README.rst @@ -148,8 +148,8 @@ To rekick all VMs, the following command can be used on the host machine to cycl 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}" + echo y | lvremove "/dev/mapper/vg01-${VM_NAME}" + lvcreate -L 92160M vg01 -n "${VM_NAME}" virsh start "${VM_NAME}" done diff --git a/multi-node-aio/playbooks/deploy-dhcp.yml b/multi-node-aio/playbooks/deploy-dhcp.yml index ac3c9bbd..a3dea2a8 100644 --- a/multi-node-aio/playbooks/deploy-dhcp.yml +++ b/multi-node-aio/playbooks/deploy-dhcp.yml @@ -66,7 +66,5 @@ state: restarted with_items: "{{ mnaio_dhcp_distro_packages }}" - vars_files: - - vars/main.yml tags: - deploy-dhcpd diff --git a/multi-node-aio/playbooks/deploy-osa.yml b/multi-node-aio/playbooks/deploy-osa.yml index 718b12e7..16e79ea9 100644 --- a/multi-node-aio/playbooks/deploy-osa.yml +++ b/multi-node-aio/playbooks/deploy-osa.yml @@ -13,102 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - -- name: Setup cinder host volume - hosts: cinder_hosts:swift_hosts - gather_facts: false - tasks: - - name: un-mount deleteme mount - mount: - name: "/var/lib/lxc" - state: unmounted - - - name: remote deleteme mount - mount: - name: "/var/lib/lxc" - state: absent - - - name: Remove deleteme lv - lvol: - vg: vg00 - lv: lxc00 - 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" - - vars_files: - - vars/main.yml - tags: - - deploy-osa - - -- name: Setup swift 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 - - vars_files: - - vars/main.yml - tags: - - deploy-osa - - - name: Setup deploy host hosts: deploy_hosts gather_facts: "{{ gather_facts | default(true) }}" @@ -219,7 +123,5 @@ when: - run_osa | default(true) | bool - vars_files: - - vars/main.yml tags: - deploy-osa diff --git a/multi-node-aio/playbooks/deploy-pxe.yml b/multi-node-aio/playbooks/deploy-pxe.yml index 9220b9e9..06a95ec3 100644 --- a/multi-node-aio/playbooks/deploy-pxe.yml +++ b/multi-node-aio/playbooks/deploy-pxe.yml @@ -187,35 +187,46 @@ group: root with_items: - src: basic-interface.cfg - dest: basic-interface.cfg + dest: "basic-{{ ansible_os_family | lower }}-interface.cfg" dir: networking + - src: vm-post-install-script.sh.j2 + dest: "vm-post-install-{{ ansible_os_family | lower }}-script.sh" + dir: scripts + + - name: network scripts for an MNAIO + template: + src: "mnaio/{{ ansible_os_family | lower }}/{{ item.src }}" + dest: /var/www/pxe/{{ item.dir }}/{{ item.dest }} + mode: "0644" + owner: root + group: root + when: + - groups['mnaio_hosts'] | default([]) | length > 0 + with_items: - 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 + dest: /var/www/pxe/networking/{{ hostvars[item]['server_hostname'] }}-bridges.cfg mode: "0644" owner: root group: root - with_items: "{{ servers }}" + with_items: "{{ groups['pxe_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(':', '-') }}" + dest: "/var/lib/tftpboot/pxelinux.cfg/01-{{ hostvars[item]['server_mac_address'] | replace(':', '-') }}" mode: "0644" owner: root group: root - with_items: "{{ servers }}" + with_items: "{{ groups['pxe_servers'] }}" - name: Preseeds for pxe mnaio template: @@ -290,7 +301,5 @@ state: restarted enabled: yes - vars_files: - - vars/main.yml tags: - deploy-pxe diff --git a/multi-node-aio/playbooks/deploy-vms.yml b/multi-node-aio/playbooks/deploy-vms.yml index 24f88e04..8c3c1c52 100644 --- a/multi-node-aio/playbooks/deploy-vms.yml +++ b/multi-node-aio/playbooks/deploy-vms.yml @@ -32,36 +32,44 @@ - name: Create VM LV lvol: vg: vg01 - lv: "{{ item.server_hostname }}" + lv: "{{ hostvars[item]['server_hostname'] }}" size: "{{ default_vm_storage }}" - with_items: "{{ servers }}" + when: + - hostvars[item]['server_vm'] | default(false) | bool + with_items: "{{ groups['pxe_servers'] }}" - name: Create the VM template template: src: kvm/kvm-vm.xml - dest: "/etc/libvirt/qemu/{{ item.server_hostname }}.xml" + dest: "/etc/libvirt/qemu/{{ hostvars[item]['server_hostname'] }}.xml" mode: 0644 owner: root group: root - with_items: "{{ servers }}" + when: + - hostvars[item]['server_vm'] | default(false) | bool + with_items: "{{ groups['pxe_servers'] }}" - name: Define the VM - command: "virsh define /etc/libvirt/qemu/{{ item.server_hostname }}.xml" + command: "virsh define /etc/libvirt/qemu/{{ hostvars[item]['server_hostname'] }}.xml" failed_when: false - with_items: "{{ servers }}" + when: + - hostvars[item]['server_vm'] | default(false) | bool + with_items: "{{ groups['pxe_servers'] }}" - name: Create the VM - command: "virsh create /etc/libvirt/qemu/{{ item.server_hostname }}.xml" + command: "virsh create /etc/libvirt/qemu/{{ hostvars[item]['server_hostname'] }}.xml" failed_when: false - with_items: "{{ servers }}" + when: + - hostvars[item]['server_vm'] | default(false) | bool + with_items: "{{ groups['pxe_servers'] }}" - name: Start the VM - command: "virsh start {{ item.server_hostname }}" + command: "virsh start {{ hostvars[item]['server_hostname'] }}" failed_when: false - with_items: "{{ servers }}" + when: + - hostvars[item]['server_vm'] | default(false) | bool + with_items: "{{ groups['pxe_servers'] }}" - vars_files: - - vars/main.yml tags: - deploy-vms @@ -70,14 +78,14 @@ hosts: localhost gather_facts: false tasks: - - name: Servers group + - name: VM Servers group add_host: - name: "{{ item.server_vm_fixed_addr }}" + name: "{{ hostvars[item]['server_vm_fixed_addr'] }}" groups: vm_servers - with_items: "{{ servers }}" + when: + - hostvars[item]['server_vm'] | default(false) | bool + with_items: "{{ groups['pxe_servers'] }}" - vars_files: - - vars/main.yml tags: - deploy-vms @@ -86,11 +94,16 @@ hosts: vm_servers gather_facts: false pre_tasks: - - name: Wait for container connectivity - wait_for_connection: + - name: Wait for connectivity 1 + local_action: + module: wait_for + host: "{{ ansible_host }}" connect_timeout: 5 + port: 22 sleep: 10 timeout: 1200 + state: started + search_regex: OpenSSH tasks: - name: copy host keys copy: @@ -103,7 +116,100 @@ - src: /root/.ssh/id_rsa.pub dest: /root/.ssh/id_rsa.pub - vars_files: - - vars/main.yml tags: - - deploy-vms \ No newline at end of file + - deploy-vms + + +- name: Setup cinder host volume + hosts: cinder_hosts:swift_hosts + gather_facts: false + tasks: + - name: un-mount deleteme mount + mount: + name: "/var/lib/lxc" + state: unmounted + + - name: remote deleteme mount + mount: + name: "/var/lib/lxc" + state: absent + + - name: Remove deleteme lv + lvol: + vg: vg00 + lv: lxc00 + force: true + state: absent + + tags: + - deploy-vms + + +- 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" + + tags: + - deploy-vms + + +- name: Setup swift 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 + + tags: + - deploy-vms diff --git a/multi-node-aio/playbooks/dhcp/dhcpd.conf.j2 b/multi-node-aio/playbooks/dhcp/dhcpd.conf.j2 index 970a1332..24ac5738 100644 --- a/multi-node-aio/playbooks/dhcp/dhcpd.conf.j2 +++ b/multi-node-aio/playbooks/dhcp/dhcpd.conf.j2 @@ -37,11 +37,11 @@ shared-network all-networks { {% endfor %} group { - {% 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 }}"; + {% for item in groups['pxe_servers'] %} + host {{ hostvars[item]['server_hostname'] }} { + hardware ethernet {{ hostvars[item]['server_mac_address'] }}; + fixed-address {{ hostvars[item]['server_vm_fixed_addr'] }}; + option host-name "{{ hostvars[item]['server_hostname'] }}"; } {% endfor %} diff --git a/multi-node-aio/playbooks/group_vars/all.yml b/multi-node-aio/playbooks/group_vars/all.yml new file mode 100644 index 00000000..a947a4ef --- /dev/null +++ b/multi-node-aio/playbooks/group_vars/all.yml @@ -0,0 +1,66 @@ +--- +# 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. + +default_interface: "{{ default_network | default('eth0') }}" +default_vm_image: "{{ default_image | default('ubuntu-16.04-amd64') }}" +default_vm_storage: "{{ vm_disk_size | default(92160) }}" + +default_os_families: + ubuntu-16.04-amd64: debian + ubuntu-14.04-amd64: debian + +default_ubuntu_mirror_proxy: 'http://10.0.2.1:3142/' +default_ubuntu_mirror_hostname: archive.ubuntu.com +default_ubuntu_mirror_directory: /ubuntu + + # IP address, or domain name of the TFTP server +tftp_server: "{{ ansible_host }}" +# tftp_ssh_key: '' # user defined ssh key, used to access the host +tftp_port: 69 + +# Default ISO images +images: + ubuntu-16.04-amd64: + image_type: debian + image_iso_url: "http://releases.ubuntu.com/16.04.2/ubuntu-16.04.2-server-amd64.iso" + image_name: "ubuntu-16.04.2-server-amd64.iso" + image_short_name: "ubuntu-16.04.2-server-amd64" + image_default_boot: "ubuntu-16.04.2-server-amd64/amd64/boot-screens/menu.cfg" + image_kernel_options: "biosdevname=0 net.ifnames=0 auto=true priority=critical vga=789" + image_kernel: "ubuntu-16.04.2-server-amd64/amd64/linux" + image_initrd: "ubuntu-16.04.2-server-amd64/amd64/initrd.gz" + image_netboot: "ubuntu-16.04.2-server-amd64/install/netboot/ubuntu-installer" + image_preseeds: + mnaio: + url: "tftp://{{ tftp_server }}/preseed/mnaio.preseed" + template_name: "mnaio.preseed" + vm: + url: "tftp://{{ tftp_server }}/preseed/vm.preseed" + template_name: "vm.preseed" + ubuntu-14.04-amd64: + image_type: debian + image_iso_url: "http://releases.ubuntu.com/14.04.5/ubuntu-14.04.5-server-amd64.iso" + image_name: "ubuntu-14.04.5-server-amd64.iso" + image_short_name: "ubuntu-14.04.5-server-amd64" + image_default_boot: "ubuntu-14.04.5-server-amd64/amd64/boot-screens/menu.cfg" + image_kernel_options: "biosdevname=0 net.ifnames=0 auto=true priority=critical vga=789" + image_kernel: "ubuntu-14.04.5-server-amd64/amd64/linux" + image_initrd: "ubuntu-14.04.5-server-amd64/amd64/initrd.gz" + image_netboot: "ubuntu-14.04.5-server-amd64/install/netboot/ubuntu-installer" + image_preseeds: + mnaio: + url: "tftp://{{ tftp_server }}/preseed/mnaio.preseed" + template_name: "mnaio.preseed" + vm: + url: "tftp://{{ tftp_server }}/preseed/vm.preseed" + template_name: "vm.preseed" diff --git a/multi-node-aio/playbooks/group_vars/dhcp_hosts.yml b/multi-node-aio/playbooks/group_vars/dhcp_hosts.yml new file mode 100644 index 00000000..2fcea994 --- /dev/null +++ b/multi-node-aio/playbooks/group_vars/dhcp_hosts.yml @@ -0,0 +1,28 @@ +--- +# 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. + +dhcp_default_lease_time: 21600 # Default lease time +dhcp_max_lease_time: 43200 # Max lease time +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: "{{ tftp_server }}" # The server hosting the TFTP server - The default is used if this is not defined + dhcp_default_domain_name: openstackci.local diff --git a/multi-node-aio/playbooks/group_vars/mnaio_hosts.yml b/multi-node-aio/playbooks/group_vars/mnaio_hosts.yml new file mode 100644 index 00000000..2f1bf580 --- /dev/null +++ b/multi-node-aio/playbooks/group_vars/mnaio_hosts.yml @@ -0,0 +1,83 @@ +--- +# 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. + +# mnaio_data_disk: 'sdc' # str - not required, set this to define a given data disk if no data disk +# is defined the largest unpartitioned disk will be used. +mnaio_host_networks: + dhcp: + iface: 'vm-br-dhcp' # str - required, interface name + inet_type: 'static' # str - required, iface type [static, dhcp, manual] + address: '10.0.2.1/22' # str - not required, must be in CIDR format + iface_port: none # str - required, physical port used within a host bridge + mgmt: + iface: 'vm-br-eth1' + inet_type: 'static' + address: '10.0.236.1/22' + iface_port: none + flat: + iface: 'vm-br-eth2' + inet_type: 'static' + address: '10.0.248.1/22' + iface_port: none + vlan: + iface: 'vm-br-eth3' + inet_type: 'manual' + iface_port: none + vxlan: + iface: 'vm-br-eth4' + inet_type: 'manual' + address: '10.0.240.1/22' + iface_port: none + storage: + iface: 'vm-br-eth5' + inet_type: 'manual' + address: '10.0.244.1/22' + iface_port: none + +mnaio_host_iptables_rules: + - table: filter + chain: INPUT + protocol: tcp + match: tcp + destination_port: 67 + jump: ACCEPT + - table: filter + chain: INPUT + protocol: udp + match: udp + destination_port: 67 + jump: ACCEPT + - table: filter + chain: INPUT + protocol: udp + match: udp + destination_port: 53 + jump: ACCEPT + - table: filter + chain: INPUT + protocol: udp + match: udp + destination_port: 53 + jump: ACCEPT + - table: filter + chain: FORWARD + in_interface: vm-br-dhcp + jump: ACCEPT + - table: filter + chain: FORWARD + out_interface: vm-br-dhcp + jump: ACCEPT + - table: nat + chain: POSTROUTING + out_interface: "{{ masquerade_interface | default(default_interface) }}" + jump: MASQUERADE diff --git a/multi-node-aio/playbooks/group_vars/pxe_hosts.yml b/multi-node-aio/playbooks/group_vars/pxe_hosts.yml new file mode 100644 index 00000000..1c6f98f8 --- /dev/null +++ b/multi-node-aio/playbooks/group_vars/pxe_hosts.yml @@ -0,0 +1,16 @@ +--- +# 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. + +pxelinux_url: "https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz" +pxelinux_name: "syslinux-6.03.tar.gz" +pxelinux_short_name: "syslinux-6.03" diff --git a/multi-node-aio/playbooks/host_vars/cinder1.yml b/multi-node-aio/playbooks/host_vars/cinder1.yml new file mode 100644 index 00000000..05044211 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/cinder1.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'cinder1' +server_vm: true +server_vm_ram: 2048 +server_vm_vcpus: 2 +server_vm_fixed_addr: '10.0.2.130' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:07' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.107/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.107/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.107/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.107/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/cinder2.yml b/multi-node-aio/playbooks/host_vars/cinder2.yml new file mode 100644 index 00000000..c39db66f --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/cinder2.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'cinder2' +server_vm: true +server_vm_ram: 2048 +server_vm_vcpus: 2 +server_vm_fixed_addr: '10.0.2.131' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:08' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.108/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.108/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.108/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.108/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/compute1.yml b/multi-node-aio/playbooks/host_vars/compute1.yml new file mode 100644 index 00000000..20522e8e --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/compute1.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'compute1' +server_vm: true +server_vm_ram: 2048 +server_vm_vcpus: 4 +server_vm_fixed_addr: '10.0.2.120' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:05' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.105/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.105/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.105/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.105/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/compute2.yml b/multi-node-aio/playbooks/host_vars/compute2.yml new file mode 100644 index 00000000..fde20a25 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/compute2.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'compute2' +server_vm: true +server_vm_ram: 2048 +server_vm_vcpus: 4 +server_vm_fixed_addr: '10.0.2.121' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:06' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.106/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.106/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.106/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.106/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/example-host1.yml.example b/multi-node-aio/playbooks/host_vars/example-host1.yml.example new file mode 100644 index 00000000..370747a0 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/example-host1.yml.example @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" # str - Set the ansible os family + +server_hostname: 'example-host1' # str - required, hostname of server +server_vm: true # bool - not required, used to specify a host is to become a VM +server_vm_ram: 8192 # int - not required, used to specify ram when provisioning a VM +server_vm_vcpus: 4 # int - not required, used to specify vcpus when provisioning a VM +server_vm_fixed_addr: '10.0.2.200' # str - not required, used to specify fixed address when using internal DHCPD +server_vm_primary_network: 'dhcp' # str - not required, primary network used to kick the VM +server_image: "{{ default_vm_image }}" # str - required, image name +server_default_interface: 'eth0' # str - required, default interface +server_mac_address: '52:54:00:bd:80:20' # str - required, mac address of default interface +server_preseed_ks: 'vm' # str - required, name of preseed/kickstart file +server_extra_options: '' # str - not required, added kernel options + +server_networks: # dict - required, hash of networks, can be empty, key is used to name the networks. + dhcp: + iface: 'eth0' # str - required, interface name + inet_type: 'dhcp' # str - required, iface type [static, dhcp, manual] + vm_int_iface: vm-br-dhcp # str - not Required, used to specify an integration networks interface when provisioning a VM + mgmt: + iface: 'eth1' # str - required, interface name + inet_type: 'static' # str - required, iface type [static, dhcp, manual] + address: '10.0.236.200/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth1 # str - not Required, used to specify an integration networks interface when provisioning a VM + flat: + iface: 'eth2' # str - required, interface name + inet_type: 'static' # str - required, iface type [static, dhcp, manual] + address: '10.0.248.200/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth2 # str - not Required, used to specify an integration networks interface when provisioning a VM + vlan: + iface: 'eth3' # str - required, interface name + inet_type: 'manual' # str - required, iface type [static, dhcp, manual] + vm_int_iface: vm-br-eth3 # str - not Required, used to specify an integration networks interface when provisioning a VM + vxlan: + iface: 'eth4' # str - required, interface name + inet_type: 'manual' # str - required, iface type [static, dhcp, manual] + address: '10.0.240.200/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth4 # str - not Required, used to specify an integration networks interface when provisioning a VM + storage: + iface: 'eth5' # str - required, interface name + inet_type: 'manual' # str - required, iface type [static, dhcp, manual] + address: '10.0.244.200/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth5 # str - not Required, used to specify an integration networks interface when provisioning a VM diff --git a/multi-node-aio/playbooks/host_vars/infra1.yml b/multi-node-aio/playbooks/host_vars/infra1.yml new file mode 100644 index 00000000..17086f80 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/infra1.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'infra1' # str - required, hostname of server +server_vm: true # bool - not required, used to specify a host is to become a VM +server_vm_ram: 8192 # int - not required, used to specify ram when provisioning a VM +server_vm_vcpus: 4 # int - not required, used to specify vcpus when provisioning a VM +server_vm_fixed_addr: '10.0.2.100' # str - not required, used to specify fixed address when using internal DHCPD +server_vm_primary_network: 'dhcp' # str - not required, primary network used to kick the VM +server_image: "{{ default_vm_image }}" # str - required, image name +server_default_interface: 'eth0' # str - required, default interface +server_mac_address: '52:54:00:bd:80:00' # str - required, mac address of default interface +server_preseed_ks: 'vm' # str - required, name of preseed/kickstart file +server_extra_options: '' # str - not required, added kernel options + +server_networks: # dict - required, hash of networks, can be empty, key is used to name the networks. + dhcp: + iface: 'eth0' # str - required, interface name + inet_type: 'dhcp' # str - required, iface type [static, dhcp, manual] + vm_int_iface: vm-br-dhcp # str - not Required, used to specify an integration networks interface when provisioning a VM + mgmt: + iface: 'eth1' # str - required, interface name + inet_type: 'static' # str - required, iface type [static, dhcp, manual] + address: '10.0.236.100/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth1 # str - not Required, used to specify an integration networks interface when provisioning a VM + flat: + iface: 'eth2' # str - required, interface name + inet_type: 'static' # str - required, iface type [static, dhcp, manual] + address: '10.0.248.100/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth2 # str - not Required, used to specify an integration networks interface when provisioning a VM + vlan: + iface: 'eth3' # str - required, interface name + inet_type: 'manual' # str - required, iface type [static, dhcp, manual] + vm_int_iface: vm-br-eth3 # str - not Required, used to specify an integration networks interface when provisioning a VM + vxlan: + iface: 'eth4' # str - required, interface name + inet_type: 'manual' # str - required, iface type [static, dhcp, manual] + address: '10.0.240.100/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth4 # str - not Required, used to specify an integration networks interface when provisioning a VM + storage: + iface: 'eth5' # str - required, interface name + inet_type: 'manual' # str - required, iface type [static, dhcp, manual] + address: '10.0.244.100/22' # str - not required, must be in CIDR format + vm_int_iface: vm-br-eth5 # str - not Required, used to specify an integration networks interface when provisioning a VM diff --git a/multi-node-aio/playbooks/host_vars/infra2.yml b/multi-node-aio/playbooks/host_vars/infra2.yml new file mode 100644 index 00000000..a1646646 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/infra2.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'infra2' +server_vm: true +server_vm_ram: 8192 +server_vm_vcpus: 4 +server_vm_fixed_addr: '10.0.2.101' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:01' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.101/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.101/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.101/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.101/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/infra3.yml b/multi-node-aio/playbooks/host_vars/infra3.yml new file mode 100644 index 00000000..db7855e8 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/infra3.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'infra3' +server_vm: true +server_vm_ram: 8192 +server_vm_vcpus: 4 +server_vm_fixed_addr: '10.0.2.102' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:02' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.102/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.102/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.102/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.102/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/loadbalancer1.yml b/multi-node-aio/playbooks/host_vars/loadbalancer1.yml new file mode 100644 index 00000000..f179ac4b --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/loadbalancer1.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'loadbalancer1' +server_vm: true +server_vm_ram: 1024 +server_vm_vcpus: 1 +server_vm_fixed_addr: '10.0.2.142' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:12' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.112/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.112/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.112/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.112/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/logging1.yml b/multi-node-aio/playbooks/host_vars/logging1.yml new file mode 100644 index 00000000..793dc928 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/logging1.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'logging1' +server_vm: true +server_vm_ram: 1024 +server_vm_vcpus: 2 +server_vm_fixed_addr: '10.0.2.110' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:03' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.103/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.103/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.103/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.103/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/swift1.yml b/multi-node-aio/playbooks/host_vars/swift1.yml new file mode 100644 index 00000000..d91b6b0d --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/swift1.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'swift1' +server_vm: true +server_vm_ram: 2048 +server_vm_vcpus: 2 +server_vm_fixed_addr: '10.0.2.140' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:09' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.109/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.109/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.109/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.109/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/swift2.yml b/multi-node-aio/playbooks/host_vars/swift2.yml new file mode 100644 index 00000000..b17ff505 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/swift2.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'swift2' +server_vm: true +server_vm_ram: 2048 +server_vm_vcpus: 2 +server_vm_fixed_addr: '10.0.2.140' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:10' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.110/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.110/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.110/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.110/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/host_vars/swift3.yml b/multi-node-aio/playbooks/host_vars/swift3.yml new file mode 100644 index 00000000..fab846d2 --- /dev/null +++ b/multi-node-aio/playbooks/host_vars/swift3.yml @@ -0,0 +1,58 @@ +--- +# 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. + +ansible_os_family: "{{ images[default_vm_image]['image_type'] }}" + +server_hostname: 'swift3' +server_vm: true +server_vm_ram: 2048 +server_vm_vcpus: 2 +server_vm_fixed_addr: '10.0.2.141' +server_vm_primary_network: 'dhcp' +server_image: "{{ default_vm_image }}" +server_default_interface: 'eth0' +server_mac_address: '52:54:00:bd:80:11' +server_preseed_ks: 'vm' +server_extra_options: '' + +server_networks: + dhcp: + iface: 'eth0' + inet_type: 'dhcp' + vm_int_iface: vm-br-dhcp + mgmt: + iface: 'eth1' + inet_type: 'static' + address: '10.0.236.111/22' + vm_int_iface: vm-br-eth1 + flat: + iface: 'eth2' + inet_type: 'static' + address: '10.0.248.111/22' + vm_int_iface: vm-br-eth2 + vlan: + iface: 'eth3' + inet_type: 'manual' + vm_int_iface: vm-br-eth3 + vxlan: + iface: 'eth4' + inet_type: 'static' + address: '10.0.240.111/22' + vm_int_iface: vm-br-eth4 + storage: + iface: 'eth5' + inet_type: 'static' + address: '10.0.244.111/22' + vm_int_iface: vm-br-eth5 diff --git a/multi-node-aio/playbooks/inventory b/multi-node-aio/playbooks/inventory index 7f39eb78..d5dc146d 100644 --- a/multi-node-aio/playbooks/inventory +++ b/multi-node-aio/playbooks/inventory @@ -1,50 +1,84 @@ +################################## ALL HOSTS ################################## [all] -localhost ansible_connection=local -mnaio1 ansible_host=10.0.2.1 +# Local host +localhost ansible_connection=local -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 -loadbalancer1 ansible_host=10.0.236.112 +# MNAIO host +mnaio1 ansible_host=10.0.2.1 ansible_connection=local -[pxe_hosts] -mnaio1 +# MNAIO VMs +infra1 ansible_host=10.0.236.100 +infra2 ansible_host=10.0.236.101 +infra3 ansible_host=10.0.236.102 +cinder2 ansible_host=10.0.236.108 +logging1 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 +swift1 ansible_host=10.0.236.109 +swift2 ansible_host=10.0.236.110 +swift3 ansible_host=10.0.236.111 +loadbalancer1 ansible_host=10.0.236.112 -[dhcp_hosts] -mnaio1 +################################# MNAIO HOSTS ################################# +# The group "vm_hosts" is used to define all host machines that will be running +# traditional virtualization using KVM. [vm_hosts] mnaio1 +################################## PXE HOSTS ################################## + +# The group "mnaio_hosts" is used to define all host machines that will serve +# the purpose of running an MNAIO test environment. +[mnaio_hosts] +mnaio1 + +# The group "pxe_hosts" is used to setup all systems that will be responsible +# for PXE boot. This will install all of the needed capabilities to TFTP serve +# system images. +[pxe_hosts] +mnaio1 + +# The group "dhcp_hosts" is used to setup all systems that will be responsible +# for DHCP. This is not required as external DHCP could be used. +[dhcp_hosts] +mnaio1 + +# The group "pxe_servers" is used to create PXE specific configurations for +# each host machines. +[pxe_servers] +cinder1 +cinder2 +compute1 +compute2 +infra1 +infra2 +infra3 +loadbalancer1 +logging1 +swift1 +swift2 +swift3 + +################################## OSA HOSTS ################################## + +# The group "deploy_hosts" is used to define where an OSA deployment will +# originate from. [deploy_hosts] infra1 +############################### OSA MNAIO HOSTS ############################### + +# The group "swift_hosts" is used in the MNAIO setup to create the basic drive +# setup needed for a swift deployment. [swift_hosts] swift1 swift2 swift3 +# The group "cinder_hosts" is used in the MNAIO setup to create the basic drive +# setup needed for a cinder LVM deployment. [cinder_hosts] cinder1 cinder2 - -[openstack_hosts] -infra1 -infra2 -infra3 -log1 -compute1 -compute2 -cinder2 -cinder1 -swift1 -swift2 -swift3 diff --git a/multi-node-aio/playbooks/kvm/kvm-vm.xml b/multi-node-aio/playbooks/kvm/kvm-vm.xml index f9a195c7..f44bcd43 100644 --- a/multi-node-aio/playbooks/kvm/kvm-vm.xml +++ b/multi-node-aio/playbooks/kvm/kvm-vm.xml @@ -1,10 +1,10 @@ - {{ item.server_hostname }} - {{ item.server_vm_ram }} - {{ item.server_vm_ram }} -{% set _vcpus_threads = ((item.server_vm_vcpus | int) // 2) %} + {{ hostvars[item]['server_hostname'] }} + {{ hostvars[item]['server_vm_ram'] }} + {{ hostvars[item]['server_vm_ram'] }} +{% set _vcpus_threads = ((hostvars[item]['server_vm_vcpus'] | int) // 2) %} {% set vcpus_threads = (_vcpus_threads | int) == 0 | ternary('1', _vcpus_threads) %} -{% set vcpus = (item.server_vm_vcpus | int) * (vcpus_threads | int) %} +{% set vcpus = (hostvars[item]['server_vm_vcpus'] | int) * (vcpus_threads | int) %} {{ vcpus | int }} /machine @@ -18,7 +18,7 @@ - + @@ -36,7 +36,7 @@ /usr/bin/kvm-spice - +
@@ -49,10 +49,10 @@
-{% for _key, _value in item.server_networks.items()|sort(attribute='1.iface') %} +{% for _key, _value in hostvars[item]['server_networks'].items()|sort(attribute='1.iface') %} -{% if _key == item.server_vm_primary_network %} - +{% if _key == hostvars[item]['server_vm_primary_network'] %} + {% endif %} @@ -98,4 +98,4 @@ - \ No newline at end of file + diff --git a/multi-node-aio/playbooks/pxe/debian/mnaio-bridges.cfg.j2 b/multi-node-aio/playbooks/mnaio/debian/mnaio-bridges.cfg.j2 similarity index 100% rename from multi-node-aio/playbooks/pxe/debian/mnaio-bridges.cfg.j2 rename to multi-node-aio/playbooks/mnaio/debian/mnaio-bridges.cfg.j2 diff --git a/multi-node-aio/playbooks/pxe/debian/mnaio-post-install-script.sh.j2 b/multi-node-aio/playbooks/mnaio/debian/mnaio-post-install-script.sh.j2 similarity index 80% rename from multi-node-aio/playbooks/pxe/debian/mnaio-post-install-script.sh.j2 rename to multi-node-aio/playbooks/mnaio/debian/mnaio-post-install-script.sh.j2 index 753bd3c4..cc81cb70 100644 --- a/multi-node-aio/playbooks/pxe/debian/mnaio-post-install-script.sh.j2 +++ b/multi-node-aio/playbooks/mnaio/debian/mnaio-post-install-script.sh.j2 @@ -12,4 +12,4 @@ chmod 0700 /root/.ssh echo "{{ tftp_ssh_key }}" >> /root/.ssh/authorized_keys wget --no-proxy http://{{ tftp_server }}/networking/mnaio-bridges.cfg -O /etc/network/interfaces.d/mnaio-bridges.cfg -wget --no-proxy http://{{ tftp_server }}/networking/basic-interface.cfg -O /etc/network/interfaces +wget --no-proxy http://{{ tftp_server }}/networking/basic-debian-interface.cfg -O /etc/network/interfaces diff --git a/multi-node-aio/playbooks/osa/openstack_user_config.yml b/multi-node-aio/playbooks/osa/openstack_user_config.yml index 669a5bfb..479eb89c 100644 --- a/multi-node-aio/playbooks/osa/openstack_user_config.yml +++ b/multi-node-aio/playbooks/osa/openstack_user_config.yml @@ -87,7 +87,7 @@ global_overrides: ### Anchors ### log_block: &log_block - log1: + logging1: ip: 10.0.236.103 infra_block: &infra_block diff --git a/multi-node-aio/playbooks/pxe/debian/basic-interface.cfg b/multi-node-aio/playbooks/pxe/debian/basic-interface.cfg index 02e7e50b..564167e0 100644 --- a/multi-node-aio/playbooks/pxe/debian/basic-interface.cfg +++ b/multi-node-aio/playbooks/pxe/debian/basic-interface.cfg @@ -4,4 +4,4 @@ auto lo iface lo inet loopback -source /etc/network/interfaces.d/*.cfg \ No newline at end of file +source /etc/network/interfaces.d/*.cfg diff --git a/multi-node-aio/playbooks/pxe/debian/vm-bridges.cfg.j2 b/multi-node-aio/playbooks/pxe/debian/vm-bridges.cfg.j2 index e2c56074..483f6ca3 100644 --- a/multi-node-aio/playbooks/pxe/debian/vm-bridges.cfg.j2 +++ b/multi-node-aio/playbooks/pxe/debian/vm-bridges.cfg.j2 @@ -1,6 +1,7 @@ # Physical interface, could be bond. This only needs to be set once +{% set server_networks = hostvars[item]['server_networks'] %} -{% for key, value in item.server_networks.items()|sort(attribute='1.iface') %} +{% for key, value in server_networks.items()|sort(attribute='1.iface') %} {% if value.iface is defined %} auto {{ value.iface }} iface {{ value.iface }} inet manual @@ -8,7 +9,7 @@ iface {{ value.iface }} inet manual {% endfor %} -{% for key, value in item.server_networks.items()|sort(attribute='1.iface') %} +{% for key, value in server_networks.items()|sort(attribute='1.iface') %} auto br-{{ key }} iface br-{{ key }} inet {{ value.inet_type }} bridge_stp off diff --git a/multi-node-aio/playbooks/pxe/debian/vm-post-install-script.sh.j2 b/multi-node-aio/playbooks/pxe/debian/vm-post-install-script.sh.j2 index c85c4d54..20034141 100644 --- a/multi-node-aio/playbooks/pxe/debian/vm-post-install-script.sh.j2 +++ b/multi-node-aio/playbooks/pxe/debian/vm-post-install-script.sh.j2 @@ -12,7 +12,7 @@ chmod 0700 /root/.ssh echo "{{ tftp_ssh_key }}" >> /root/.ssh/authorized_keys wget --no-proxy http://{{ tftp_server }}/networking/$(cat /etc/hostname)-bridges.cfg -O /etc/network/interfaces.d/vm-bridges.cfg -wget --no-proxy http://{{ tftp_server }}/networking/basic-interface.cfg -O /etc/network/interfaces +wget --no-proxy http://{{ tftp_server }}/networking/basic-debian-interface.cfg -O /etc/network/interfaces cat > /etc/network/if-up.d/post-up-rules <