Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ci/playbooks/deploy_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
register: result
until: result.rc == 0

- name: Copy root's key to node 4 @{{ admin_ip_4 }}
command: "sshpass -p {{ node_host_pass }} ssh-copy-id -i /root/.ssh/id_rsa.pub -o StrictHostKeyChecking=no root@{{ admin_ip_4 }}"
retries: 30
delay: 3
register: result
until: result.rc == 0

- name: Modify Build server configfs
command: "modprobe configfs"

Expand All @@ -101,6 +108,12 @@
- name: Restart Node 3 sys-kernel-config.mount
command: "ssh root@{{ admin_ip_3 }} 'systemctl restart sys-kernel-config.mount'"

- name: Modify Node 4 configfs
command: "ssh root@{{ admin_ip_4 }} 'modprobe configfs'"

- name: Restart Node 4 sys-kernel-config.mount
command: "ssh root@{{ admin_ip_4 }} 'systemctl restart sys-kernel-config.mount'"

- name: Apply template and copy deployment.yaml.tmplt to {{ src_copy_dir }}/deployment.yaml
action: template src=templates/deployment.yaml.tmplt dest={{ src_copy_dir }}/deployment.yaml

Expand Down
32 changes: 32 additions & 0 deletions ci/playbooks/templates/deployment.yaml.tmplt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,38 @@ openstack:
password: {{ node_host_pass }}
service_host: {{ admin_ip_1 }}
user: root
#controller HA config: Adding second controller host for HA
-
host:
hostname: CONTROLLER2
interfaces:
-
ip: {{ admin_ip_4 }}
mac: {{ admin_mac_4 }}
name: {{ admin_iface }}
type: management
-
ip: {{ private_ip_4 }}
mac: {{ private_mac_4 }}
name: {{ priv_iface }}
type: tenant
-
gateway: {{ public_gateway }}
ip: {{ public_ip_4 }}
mac: {{ public_mac_4 }}
name: {{ pub_iface }}
type: data
isolcpus: {{ isolcpus }}
reserved_host_memory_mb: {{ host_memory_mb }}
node_type:
- controller
- storage
second_storage:
- "/dev/vdb"
password: {{ node_host_pass }}
service_host: {{ admin_ip_1 }}
user: root
#controller HA config ends
networks:
external:
gateway: {{ public_gateway }}
Expand Down
110 changes: 108 additions & 2 deletions ci/snaps/snaps_os_tmplt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ openstack:
description: Project for Orchestrators
users: [os-deploy-user-{{ build_id }}, {{ admin_user }}]
quotas:
ram: 102400
cores: 40
ram: 128000
cores: 48
users:
- user:
os_creds_name: admin-creds
Expand Down Expand Up @@ -213,6 +213,14 @@ openstack:
project_name: os-deploy-proj-{{ build_id }}
name: os-deploy-vol3-{{ build_id }}
size: 50
#controller HA config: Adding volume for second controller instance
- volume:
os_user:
name: os-deploy-user-{{ build_id }}
project_name: os-deploy-proj-{{ build_id }}
name: os-deploy-vol4-{{ build_id }}
size: 50
#controller HA config ends
instances:
# TODO - Improve NIC config. see https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html#network-config-v2
- instance:
Expand Down Expand Up @@ -486,6 +494,72 @@ openstack:
ip_addrs:
- subnet_name: os-public-subnet-{{ build_id }}
ip: {{ pub_ip_prfx }}.13
#controller HA config: Adding one more controller instance for controller HA
- instance:
os_user:
name: os-deploy-user-{{ build_id }}
project_name: os-deploy-proj-{{ build_id }}
name: os-node-4-{{ build_id }}
flavor: os-control-flavor-{{ build_id }}
imageName: ubuntu-16-04
security_group_names: [os-deploy-build-sg-{{ build_id }}]
cloud_init_timeout: 1000
volume_names:
- os-deploy-vol4-{{ build_id }}
userdata: |
#cloud-config
chpasswd:
list: |
root:{{ node_host_password }}
expire: False
ssh_pwauth: True
packages:
- python
runcmd:
- [sh, -c, "mv /etc/network/interfaces /etc/network/interfaces.orig"]
- [sh, -c, "echo 'iface lo inet loopback' >> /etc/network/interfaces"]
- [sh, -c, "echo 'auto {{ admin_iface }}' >> /etc/network/interfaces"]
- [sh, -c, "echo ' iface {{ admin_iface }} inet static' >> /etc/network/interfaces"]
- [sh, -c, "echo ' address {{ admin_ip_prfx }}.14' >> /etc/network/interfaces"]
- [sh, -c, "echo ' netmask 255.255.255.0' >> /etc/network/interfaces"]
- [sh, -c, "echo ' mtu 1450' >> /etc/network/interfaces"]
- [sh, -c, "echo 'auto {{ priv_iface }}' >> /etc/network/interfaces"]
- [sh, -c, "echo ' iface {{ priv_iface }} inet static' >> /etc/network/interfaces"]
- [sh, -c, "echo ' address {{ priv_ip_prfx }}.14' >> /etc/network/interfaces"]
- [sh, -c, "echo ' netmask 255.255.255.0' >> /etc/network/interfaces"]
- [sh, -c, "echo ' mtu 1450' >> /etc/network/interfaces"]
- [sh, -c, "echo 'auto {{ pub_iface }}' >> /etc/network/interfaces"]
- [sh, -c, "echo ' iface {{ pub_iface }} inet static' >> /etc/network/interfaces"]
- [sh, -c, "echo ' address {{ pub_ip_prfx }}.14' >> /etc/network/interfaces"]
- [sh, -c, "echo ' netmask 255.255.255.0' >> /etc/network/interfaces"]
- [sh, -c, "echo ' gateway {{ pub_ip_prfx }}.1' >> /etc/network/interfaces"]
- [sh, -c, "echo ' dns-nameservers 8.8.8.8' >> /etc/network/interfaces"]
- [sh, -c, "echo ' mtu 1450' >> /etc/network/interfaces"]
- ip addr flush {{ admin_iface }}
- systemctl restart networking
- apt install -y python
- sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
- systemctl restart ssh
ports:
- port:
name: os-deploy-admin-port-4-{{ build_id }}
network_name: os-admin-net-{{ build_id }}
ip_addrs:
- subnet_name: os-admin-subnet-{{ build_id }}
ip: {{ admin_ip_prfx }}.14
- port:
name: os-deploy-priv-port-4-{{ build_id }}
network_name: os-priv-net-{{ build_id }}
ip_addrs:
- subnet_name: os-priv-subnet-{{ build_id }}
ip: {{ priv_ip_prfx }}.14
- port:
name: os-deploy-pub-port-4-{{ build_id }}
network_name: os-public-net-{{ build_id }}
ip_addrs:
- subnet_name: os-public-subnet-{{ build_id }}
ip: {{ pub_ip_prfx }}.14
#controller HA config ends
ansible:
# Install and configure snaps-boot to build host
- playbook_location: {{ local_snaps_openstack_dir }}/ci/playbooks/deploy_os.yaml
Expand Down Expand Up @@ -588,6 +662,38 @@ ansible:
vm_name: os-node-3-{{ build_id }}
port_name: os-deploy-pub-port-3-{{ build_id }}
port_value: mac_address
#controller HA config: Sencond controller variables
admin_ip_4:
type: port
vm_name: os-node-4-{{ build_id }}
port_name: os-deploy-admin-port-4-{{ build_id }}
port_value: ip_address
admin_mac_4:
type: port
vm_name: os-node-4-{{ build_id }}
port_name: os-deploy-admin-port-4-{{ build_id }}
port_value: mac_address
private_ip_4:
type: port
vm_name: os-node-4-{{ build_id }}
port_name: os-deploy-priv-port-4-{{ build_id }}
port_value: ip_address
private_mac_4:
type: port
vm_name: os-node-4-{{ build_id }}
port_name: os-deploy-priv-port-4-{{ build_id }}
port_value: mac_address
public_ip_4:
type: port
vm_name: os-node-4-{{ build_id }}
port_name: os-deploy-pub-port-4-{{ build_id }}
port_value: ip_address
public_mac_4:
type: port
vm_name: os-node-4-{{ build_id }}
port_name: os-deploy-pub-port-4-{{ build_id }}
port_value: mac_address
#controller HA config end
public_gateway:
type: network
network_name: os-public-net-{{ build_id }}
Expand Down
Loading