From 3f6ec2ffac6e073c55411bf733245c3716b50dbb Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 14 Feb 2018 16:38:57 -0600 Subject: [PATCH] Update mnaio to allow deployers to use nspawn This change updates the preseed files and the default openstack-user-config file so that deployers can use and test nspawn type containers using the in-built automation. Change-Id: I2ec3bd284540fa9f79490a350f016ca594fb5f98 Signed-off-by: Kevin Carter --- multi-node-aio/playbooks/group_vars/all.yml | 2 ++ .../playbooks/osa/openstack_user_config.yml | 11 +++++++++++ .../playbooks/pxe/configs/debian/mnaio.config.j2 | 11 +++++++++++ .../playbooks/pxe/configs/debian/vm.config.j2 | 11 +++++++++++ 4 files changed, 35 insertions(+) diff --git a/multi-node-aio/playbooks/group_vars/all.yml b/multi-node-aio/playbooks/group_vars/all.yml index 7c5d86b6..42472f48 100644 --- a/multi-node-aio/playbooks/group_vars/all.yml +++ b/multi-node-aio/playbooks/group_vars/all.yml @@ -24,6 +24,8 @@ default_ubuntu_mirror_proxy: 'http://10.0.2.1:3142/' default_ubuntu_mirror_hostname: archive.ubuntu.com default_ubuntu_mirror_directory: /ubuntu +default_container_tech: "{{ container_tech | default('lxc') }}" + ipxe_kernel_url: "{{ ipxe_kernel_url | default('http://boot.ipxe.org/ipxe.lkrn') }}" # IP address, or domain name of the TFTP server diff --git a/multi-node-aio/playbooks/osa/openstack_user_config.yml b/multi-node-aio/playbooks/osa/openstack_user_config.yml index 68a02bf0..f2a15322 100644 --- a/multi-node-aio/playbooks/osa/openstack_user_config.yml +++ b/multi-node-aio/playbooks/osa/openstack_user_config.yml @@ -91,6 +91,7 @@ cinder_block: &cinder_block {{ hostvars[host]['server_hostname'] }}: ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} container_vars: + container_tech: "{{ default_container_tech }}" cinder_backends: limit_container_types: cinder_volume lvm: @@ -105,6 +106,8 @@ compute_block: &compute_block {% for host in groups['compute_hosts'] %} {{ hostvars[host]['server_hostname'] }}: ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} + container_vars: + container_tech: "{{ default_container_tech }}" {% endfor %} @@ -112,6 +115,8 @@ infra_block: &infra_block {% for host in groups['infra_hosts'] %} {{ hostvars[host]['server_hostname'] }}: ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} + container_vars: + container_tech: "{{ default_container_tech }}" {% endfor %} @@ -119,6 +124,8 @@ loadbalancer_block: &loadbalancer_block {% for host in groups['loadbalancer_hosts'] %} {{ hostvars[host]['server_hostname'] }}: ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} + container_vars: + container_tech: "{{ default_container_tech }}" {% endfor %} @@ -126,6 +133,8 @@ log_block: &log_block {% for host in groups['log_hosts'] %} {{ hostvars[host]['server_hostname'] }}: ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} + container_vars: + container_tech: "{{ default_container_tech }}" {% endfor %} @@ -133,6 +142,8 @@ swift_block: &swift_block {% for host in groups['swift_hosts'] %} {{ hostvars[host]['server_hostname'] }}: ip: {{ hostvars[host]['server_networks']['mgmt']['address'].split('/')[0] }} + container_vars: + container_tech: "{{ default_container_tech }}" {% endfor %} diff --git a/multi-node-aio/playbooks/pxe/configs/debian/mnaio.config.j2 b/multi-node-aio/playbooks/pxe/configs/debian/mnaio.config.j2 index 88f275a5..58f4a17f 100644 --- a/multi-node-aio/playbooks/pxe/configs/debian/mnaio.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/debian/mnaio.config.j2 @@ -135,6 +135,16 @@ d-i partman-auto/expert_recipe string \ label{ openstack } \ mountpoint{ /openstack } \ . \ +{% if default_container_tech == 'nspawn' %} + 8192 1 24576 btrfs \ + $lvmok{ } in_vg{ vg00 } \ + lv_name{ machines00 } \ + method{ format } format{ } \ + use_filesystem{ } filesystem{ btrfs } \ + label{ machines } \ + mountpoint{ /var/lib/machines } \ + . \ +{% elif default_container_tech == 'lxc' %} 4096 1 8192 btrfs \ $lvmok{ } in_vg{ vg00 } \ lv_name{ machines00 } \ @@ -151,6 +161,7 @@ d-i partman-auto/expert_recipe string \ label{ lxc } \ mountpoint{ /var/lib/lxc } \ . \ +{% endif %} # This makes partman automatically partition without confirmation, provided # that you told it what to do using one of the methods above. diff --git a/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 b/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 index 7b890ab6..fb25b1fd 100644 --- a/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 +++ b/multi-node-aio/playbooks/pxe/configs/debian/vm.config.j2 @@ -135,6 +135,16 @@ d-i partman-auto/expert_recipe string \ label{ openstack } \ mountpoint{ /openstack } \ . \ +{% if default_container_tech == 'nspawn' %} + 8192 1 24576 btrfs \ + $lvmok{ } in_vg{ vmvg00 } \ + lv_name{ machines00 } \ + method{ format } format{ } \ + use_filesystem{ } filesystem{ btrfs } \ + label{ machines } \ + mountpoint{ /var/lib/machines } \ + . \ +{% elif default_container_tech == 'lxc' %} 4096 1 8192 btrfs \ $lvmok{ } in_vg{ vmvg00 } \ lv_name{ machines00 } \ @@ -151,6 +161,7 @@ d-i partman-auto/expert_recipe string \ label{ lxc } \ mountpoint{ /var/lib/lxc } \ . \ +{% endif %} # This makes partman automatically partition without confirmation, provided # that you told it what to do using one of the methods above.