diff --git a/multi-node-aio/playbooks/deploy-pxe.yml b/multi-node-aio/playbooks/deploy-pxe.yml index 95e282cd..8f036b80 100644 --- a/multi-node-aio/playbooks/deploy-pxe.yml +++ b/multi-node-aio/playbooks/deploy-pxe.yml @@ -59,10 +59,14 @@ command: cat /root/.ssh/id_rsa.pub register: public_key_get changed_when: false + when: + - tftp_ssh_key is undefined - name: Set key facts set_fact: tftp_ssh_key: "{{ public_key_get.stdout }}" + when: + - tftp_ssh_key is undefined tasks: - name: Drop NGINX config diff --git a/multi-node-aio/playbooks/deploy-vms.yml b/multi-node-aio/playbooks/deploy-vms.yml index 50dee597..e95fcfbe 100644 --- a/multi-node-aio/playbooks/deploy-vms.yml +++ b/multi-node-aio/playbooks/deploy-vms.yml @@ -82,7 +82,7 @@ tasks: - name: VM Servers group add_host: - name: "{{ hostvars[item]['server_vm_fixed_addr'] }}" + name: "{{ item }}" groups: vm_servers when: - hostvars[item]['server_vm'] | default(false) | bool @@ -115,9 +115,9 @@ dest: "{{ item.dest }}" mode: "0600" with_items: - - src: /root/.ssh/id_rsa + - src: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa" dest: /root/.ssh/id_rsa - - src: /root/.ssh/id_rsa.pub + - src: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub" dest: /root/.ssh/id_rsa.pub environment: "{{ deployment_environment_variables | default({}) }}" @@ -142,7 +142,7 @@ - name: Remove deleteme lv lvol: - vg: vg00 + vg: vmvg00 lv: lxc00 force: true state: absent @@ -159,7 +159,7 @@ tasks: - name: Create cinder-volumes lv lvol: - vg: vg00 + vg: vmvg00 lv: cinder-volumes00 size: "100%FREE" shrink: false @@ -167,7 +167,7 @@ - name: Create data cinder-volumes group lvg: vg: cinder-volumes - pvs: "/dev/vg00/cinder-volumes00" + pvs: "/dev/vmvg00/cinder-volumes00" environment: "{{ deployment_environment_variables | default({}) }}" @@ -181,7 +181,7 @@ tasks: - name: Remove deleteme lv lvol: - vg: vg00 + vg: vmvg00 lv: "{{ item }}" size: 4G with_items: @@ -192,7 +192,7 @@ - name: Format swift drives filesystem: fstype: xfs - dev: "/dev/vg00/{{ item }}" + dev: "/dev/vmvg00/{{ item }}" with_items: - disk1 - disk2 @@ -213,7 +213,7 @@ - name: Mount swift drives mount: name: "/srv/{{ item }}" - src: "/dev/mapper/vg00-{{ item }}" + src: "/dev/mapper/vmvg00-{{ item }}" fstype: xfs state: mounted with_items: diff --git a/multi-node-aio/playbooks/group_vars/all.yml b/multi-node-aio/playbooks/group_vars/all.yml index de8f50e7..581b1ddf 100644 --- a/multi-node-aio/playbooks/group_vars/all.yml +++ b/multi-node-aio/playbooks/group_vars/all.yml @@ -14,7 +14,7 @@ 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_acng_bind_address: 0.0.0.0 default_os_families: ubuntu-16.04-amd64: debian ubuntu-14.04-amd64: debian @@ -24,7 +24,7 @@ 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_server: "{{ hostvars[groups['pxe_hosts'][0]]['ansible_host'] | default(ansible_host) }}" # tftp_ssh_key: '' # user defined ssh key, used to access the host tftp_port: 69 @@ -74,6 +74,8 @@ mnaio_host_networks: 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 + address_aliases: # list - not required, items must be sting and in CIDR format + - '10.0.2.2/22' mgmt: iface: 'vm-br-eth1' inet_type: 'static' @@ -90,11 +92,11 @@ mnaio_host_networks: iface_port: none vxlan: iface: 'vm-br-eth4' - inet_type: 'manual' + inet_type: 'static' address: '10.0.240.1/22' iface_port: none storage: iface: 'vm-br-eth5' - inet_type: 'manual' + inet_type: 'static' address: '10.0.244.1/22' iface_port: none diff --git a/multi-node-aio/playbooks/host_vars/infra1.yml b/multi-node-aio/playbooks/host_vars/infra1.yml index 17086f80..43891060 100644 --- a/multi-node-aio/playbooks/host_vars/infra1.yml +++ b/multi-node-aio/playbooks/host_vars/infra1.yml @@ -48,11 +48,11 @@ server_networks: # dict - required, hash of networks, can 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] + inet_type: 'static' # 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] + inet_type: 'static' # 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/mnaio/debian/mnaio-bridges.cfg.j2 b/multi-node-aio/playbooks/mnaio/debian/mnaio-bridges.cfg.j2 index b0c9c07b..e5626ff6 100644 --- a/multi-node-aio/playbooks/mnaio/debian/mnaio-bridges.cfg.j2 +++ b/multi-node-aio/playbooks/mnaio/debian/mnaio-bridges.cfg.j2 @@ -15,8 +15,17 @@ iface {{ value.iface }} inet {{ value.inet_type }} bridge_fd 0 bridge_ports {{ value.iface_port }} offload-sg off -{% if value.address is defined %} +{% if value.address is defined %} address {{ value.address }} -{% endif %} +{% endif %} + +{% if value.address_aliases is defined %} +{% for addr in value.address_aliases %} +auto {{ value.iface }} +iface {{ value.iface }} inet static + address {{ addr }} +{% endfor %} + +{% endif %} {% endfor %} diff --git a/multi-node-aio/playbooks/pxe/acng.conf.j2 b/multi-node-aio/playbooks/pxe/acng.conf.j2 index 72092bbc..aac9c0ce 100644 --- a/multi-node-aio/playbooks/pxe/acng.conf.j2 +++ b/multi-node-aio/playbooks/pxe/acng.conf.j2 @@ -3,7 +3,7 @@ CacheDir: /var/www/pkg-cache LogDir: /var/log/apt-cacher-ng Port: 3142 -BindAddress: 10.0.2.1 +BindAddress: {{ default_acng_bind_address }} Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol # Debian Volatile Archives @@ -31,4 +31,4 @@ VfilePatternEx: ^/\?release=[0-9]+&arch= # that causes more intermittent 503 errors. This DontCache line # tells apt-cacher-ng to allow requests for these to pass through # without being cached. -DontCache: (mirrorlist\.centos\.org)|(mariadb\.org.*\.bz2$) \ No newline at end of file +DontCache: (mirrorlist\.centos\.org)|(mariadb\.org.*\.bz2$) diff --git a/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 b/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 index 568ced51..7a9bbf34 100644 --- a/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 +++ b/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 @@ -4,7 +4,7 @@ # 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 +d-i debian-installer/add-kernel-opts string biosdevname=0 net.ifnames=0 elevator=cfq # Networking d-i netcfg/choose_interface select eth0 diff --git a/multi-node-aio/playbooks/pxe/debian/vm.preseed.j2 b/multi-node-aio/playbooks/pxe/debian/vm.preseed.j2 index 079cad4e..d8f00949 100644 --- a/multi-node-aio/playbooks/pxe/debian/vm.preseed.j2 +++ b/multi-node-aio/playbooks/pxe/debian/vm.preseed.j2 @@ -4,7 +4,7 @@ # 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 +d-i debian-installer/add-kernel-opts string biosdevname=0 net.ifnames=0 elevator=noop # Networking d-i netcfg/choose_interface select eth0 @@ -96,7 +96,7 @@ d-i partman-auto/disk string /dev/vda # 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 -d-i partman-auto-lvm/new_vg_name string vg00 +d-i partman-auto-lvm/new_vg_name string vmvg00 d-i partman-auto/choose_recipe select custompartitioning d-i partman-auto/expert_recipe string \ @@ -113,15 +113,15 @@ d-i partman-auto/expert_recipe string \ $primary{ } \ method{ lvm } \ device{ /dev/vda2 } \ - vg_name{ vg00 } \ + vg_name{ vmvg00 } \ . \ 2048 1 4096 linux-swap \ - $lvmok{ } in_vg{ vg00 } \ + $lvmok{ } in_vg{ vmvg00 } \ lv_name{ swap00 } \ method{ swap } format{ } \ . \ 8192 1 16384 ext4 \ - $lvmok{ } in_vg{ vg00 } \ + $lvmok{ } in_vg{ vmvg00 } \ lv_name{ root00 } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ @@ -129,7 +129,7 @@ d-i partman-auto/expert_recipe string \ mountpoint{ / } \ . \ 16384 1 16384 ext4 \ - $lvmok{ } in_vg{ vg00 } \ + $lvmok{ } in_vg{ vmvg00 } \ lv_name{ openstack00 } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \ @@ -137,7 +137,7 @@ d-i partman-auto/expert_recipe string \ mountpoint{ /openstack } \ . \ 4096 1 8192 btrfs \ - $lvmok{ } in_vg{ vg00 } \ + $lvmok{ } in_vg{ vmvg00 } \ lv_name{ machines00 } \ method{ format } format{ } \ use_filesystem{ } filesystem{ btrfs } \ @@ -145,7 +145,7 @@ d-i partman-auto/expert_recipe string \ mountpoint{ /var/lib/machines } \ . \ 8192 1 10240000 ext4 \ - $lvmok{ } in_vg{ vg00 } \ + $lvmok{ } in_vg{ vmvg00 } \ lv_name{ lxc00 } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext4 } \