11 Commits

Author SHA1 Message Date
6453f1c468 Shouldn't be here in the first place. 2018-04-09 15:56:52 +02:00
3001fb8d57 test cluster for bagpipe 2018-03-23 11:37:47 +01:00
a150b58aaa Added more nodes 2018-03-14 08:54:18 +01:00
cc18e247c4 Using half the cluster for linuxbridge. 2018-03-01 15:17:50 +01:00
7114509697 More sleep for cluster 2018-02-28 10:36:17 +01:00
6a6ebd0c60 current state merlin 2018-02-22 16:32:40 +01:00
7a41ca4187 iEnsure installation of same openstack client 2018-02-22 16:31:18 +01:00
469bcd769c Added local_ip 2018-02-20 16:24:26 +01:00
598cbeec9d hope retries will work this way. 2018-02-20 15:29:14 +01:00
20ce7bcfc3 set overlay ip 2018-02-20 15:28:54 +01:00
1bbf1e4270 added retry 2018-02-20 14:24:41 +01:00
22 changed files with 102 additions and 119 deletions

View File

@ -1,6 +1,2 @@
[defaults]
inventory = hosts
stdout_callback = debug
vault_password_file = .vault_pass.txt
forks = 20
host_key_checking = false
inventory = merlin

View File

@ -1,13 +1,7 @@
---
- hosts: all
name: Dummy to gather facts
tasks:
- name: gather facts even if hosts are excluded.
setup:
delegate_to: "{{item}}"
delegate_facts: True
loop: "{{groups['all']}}"
tasks: []
- hosts: cinder-controller
become: True

View File

@ -1,11 +1,5 @@
---
- hosts: all
become: True
vars_prompt:
- name: "docker_user"
prompt: "What is your p number?"
- name: "docker_pass"
prompt: "What is your password?"
private: yes
roles:
- common

View File

@ -1,14 +0,0 @@
---
- import_tasks: common.yml
- import_tasks: rabbitmq.yml
- import_tasks: memcached.yml
- import_tasks: mariadb.yml
- import_tasks: keystone.yml
- import_tasks: glance-controller.yml
- import_tasks: nova-controller.yml
- import_tasks: neutron-controller.yml
- import_tasks: cinder-controller.yml
- import_tasks: cinder-storage.yml
- import_tasks: nova-compute.yml
- import_tasks: horizon.yml
- import_tasks: gcc-post-install.yml

View File

@ -1,2 +0,0 @@
---
security_fail2ban_enabled: false

View File

@ -6,5 +6,4 @@
- hosts: horizon
become: True
roles:
- geerlingguy.security
- horizon

View File

@ -1,2 +0,0 @@
---
listen_ip: '172.23.40.243'

View File

@ -1,2 +0,0 @@
---
listen_ip: '172.23.40.253'

38
merlin
View File

@ -1,37 +1,39 @@
[nova-compute]
merlin-managementnode002 physical_interface_mappings=provider:eno3
merlin-managementnode003 physical_interface_mappings=provider:eno3
merlin-node001 physical_interface_mappings=provider:eno3
merlin-node003 physical_interface_mappings=provider:eno3
merlin-node004 physical_interface_mappings=provider:eno3
merlin-node012 physical_interface_mappings=provider:enp129s0f1 overlay_ip=172.23.43.12
merlin-node013 physical_interface_mappings=provider:enp129s0f1 overlay_ip=172.23.43.13
merlin-node006 physical_interface_mappings=provider:enp130s0f0 overlay_ip=172.23.43.6
merlin-node007 physical_interface_mappings=provider:enp130s0f0 overlay_ip=172.23.43.7
merlin-node008 physical_interface_mappings=provider:enp130s0f0 overlay_ip=172.23.43.8
merlin-node009 physical_interface_mappings=provider:enp130s0f0 overlay_ip=172.23.43.9
merlin-node010 physical_interface_mappings=provider:enp130s0f0 overlay_ip=172.23.43.10
[databases]
merlin-managementnode001
merlin-managementnode002
merlin-managementnode003
merlin-node011
merlin-node012
merlin-node013
[rabbitmq]
merlin-managementnode001
merlin-managementnode002
merlin-managementnode003
merlin-node011
merlin-node012
merlin-node013
[horizon]
merlin-managementnode001
merlin-node011
[memcached]
merlin-managementnode001
merlin-node011
[nova-controller]
merlin-managementnode001
merlin-node011
[keystone]
merlin-managementnode001
merlin-node011
[neutron-controller]
merlin-managementnode001 physical_interface_mappings=provider:eno3
merlin-node011 physical_interface_mappings=provider:enp129s0f1 overlay_ip=172.23.43.11
[heat]
merlin-managementnode001
merlin-node011
[glance-controller]
merlin-managementnode001
merlin-node011

39
merlin-bagpipe Normal file
View File

@ -0,0 +1,39 @@
[nova-compute]
merlin-managementnode002 physical_interface_mappings=provider:enp5s0f1 overlay_ip=129.125.60.109
merlin-managementnode003 physical_interface_mappings=provider:enp5s0f1 overlay_ip=129.125.60.110
merlin-node001 physical_interface_mappings=provider:enp130s0f0 overlay_ip=129.125.60.117
merlin-node002 physical_interface_mappings=provider:enp130s0f0 overlay_ip=129.125.60.118
merlin-node003 physical_interface_mappings=provider:enp130s0f0 overlay_ip=129.125.60.119
merlin-node004 physical_interface_mappings=provider:enp130s0f0 overlay_ip=129.125.60.122
merlin-node005 physical_interface_mappings=provider:enp130s0f0 overlay_ip=129.125.60.123
[databases]
merlin-managementnode001
merlin-managementnode002
merlin-managementnode003
[rabbitmq]
merlin-managementnode001
merlin-managementnode002
merlin-managementnode003
[horizon]
merlin-managementnode001
[memcached]
merlin-managementnode001
[nova-controller]
merlin-managementnode001
[keystone]
merlin-managementnode001
[neutron-controller]
merlin-managementnode001 physical_interface_mappings=provider:enp5s0f1 overlay_ip=129.125.60.108
[heat]
merlin-managementnode001
[glance-controller]
merlin-managementnode001

View File

@ -26,14 +26,10 @@ openstack03
openstack03
[cinder-storage]
openstack01 storage_volume=/dev/sdc3
openstack02 storage_volume=/dev/sda5
openstack03 storage_volume=/dev/sdb1
openstack04 storage_volume=/dev/sdb1
[nova-compute]
openstack01 physical_interface_mappings=provider:bond0
openstack02 physical_interface_mappings=provider:enp34s0f1
openstack03 physical_interface_mappings=provider:enp4s0f0
openstack04 physical_interface_mappings=provider:eno1
[all:vars]
listen_ip=172.23.40.243

View File

@ -16,10 +16,7 @@
command: docker exec -i keystone.service bash -c "source /root/admin-openrc.sh && {{ item }}"
with_items:
- openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider
- >
openstack subnet create --network provider
--allocation-pool start={{ allocation_pool['start'] }},end={{ allocation_pool['end'] }}
--dns-nameserver {{ dns_nameserver }} --gateway {{ gateway }} --subnet-range {{ subnet_range }} providersub
- openstack network set --external provider
- openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
- openstack keypair create --public-key /root/id_rsa.pub adminkey

View File

@ -20,9 +20,7 @@
-e "OS_PASSWORD={{ secrets['OS_PASSWORD'] }}"
-e "RABBIT_HOST={{ listen_ip | default(hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address']) }}"
-e "RABBIT_PASSWORD={{ secrets['RABBIT_PASSWORD'] }}"
-e "AVAILABILITY_ZONE={{ ansible_nodename }}"
-e "RABBIT_USER=openstack"
-e "CINDER_STORAGE_VOLUME={{ storage_volume }}"
tags: vars
- name: pull docker image
@ -45,7 +43,7 @@
--privileged
{{ env_vars }}
-v /srv/cinder-storage/root:/root \
-v /dev:/dev \
-v "{{ storage_volume }}":/dev/cinder_storage_volume \
{{ docker_image }} /etc/bootstrap.sh
tags: bootstrap

View File

@ -11,10 +11,13 @@ ExecStartPre=-/usr/bin/docker rm %n
ExecStart=/usr/bin/docker run --name %n \
--privileged \
{{ env_vars | replace('\n', '') }} \
-v "/dev/cinder-volumes/":/dev/cinder-volumes \
-v /srv/cinder-storage/root:/root \
-v "/dev":/dev \
-v "/var/lib/cinder:/var/lib/cinder" \
--network=host \
-v "{{ storage_volume }}":/dev/cinder_storage_volume \
-v "/dev/lvm":/dev/lvm \
-v "/srv/cinder-storage/volumes/:/var/lib/cinder/volumes/" \
-p 8777:8776 \
-p 3260:3260 \
{{ docker_image }}
[Install]

View File

@ -5,7 +5,7 @@
- name: Passwordless sudo for admins
lineinfile: dest=/etc/sudoers line="%admin ALL=(ALL:ALL) NOPASSWD:ALL"
- import_tasks: users.yml
- include: users.yml
- name: common | install packages
apt: pkg={{ item }} state=latest update_cache=yes
@ -26,11 +26,4 @@
owner: root
group: root
#- import_tasks: docker.yml
- name: Log into DockerHub
docker_login:
registry: registry.webhosting.rug.nl
username: "{{ docker_user }}"
password: "{{ docker_pass }}"
- include: docker.yml

View File

@ -94,7 +94,8 @@
retries: 7
delay: 3
- name: install openstack repo host key.
- name: install openstack repo key host.
command: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5EDB1B62EC4926EA
tags: openstackclient

View File

@ -1,5 +1,3 @@
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD={{ hostvars[groups['keystone'][0]]['OS_PASSWORD'] }}

View File

@ -11,9 +11,9 @@
state: directory
mode: 0777
with_items:
- /srv/mariadb/lib/mysql
- /srv/mariadb/etc/mysql
- /srv/mariadb/etc/mysql/conf.d
- /srv/mariadb/lib/mysql
- /srv/mariadb/etc/mysql
- /srv/mariadb/etc/mysql/conf.d
- name: place settings file
copy:
@ -21,14 +21,12 @@
dest: /srv/mariadb/etc/mysql/conf.d/my.cnf
mode: 660
- name: >
Set galara.cnf on node if we have at least three nodes.
And we're part of the cluster.
- name: Set galara.cnf on node if we have at least three nodes.
template:
src: files/galera.cnf
dest: /srv/mariadb/etc/mysql/conf.d/galera.cnf
mode: 660
when: "'databases' in group_names and groups['databases'] | length >= 3"
when: groups['databases'] | length >= 3
# This mimics galera_new_cluster.sh
- name: Initialize a new cluster.
@ -49,8 +47,7 @@
name: mysql.service
state: started
when: "'databases' in group_names and groups['databases'] \
| length >= 3 and ansible_hostname == hostname_node0"
when: groups['databases'] | length >= 3 and ansible_hostname == hostname_node0
- name: install service file.
block:
@ -64,22 +61,17 @@
group: root
- name: Give the master node some time to initialize the cluster.
command: bash -c "sleep 60"
when: "'databases' in group_names and groups['databases'] \
| length >= 3"
- name: Daemon reload (the implicit doesn't work)
command: bash -c "systemctl daemon-reload"
command: bash -c "sleep 60 && systemctl daemon-reload"
- name: make sure service is started
systemd:
name: mysql.service
state: started
daemon_reload: yes
- name: start service at boot.
command: systemctl reenable mysql.service
- name: Give the cluster some time to initialize replication.
command: bash -c "sleep 60 && systemctl daemon-reload"
when: "'databases' in group_names and groups['databases'] | length >= 3"
when: groups['databases'] | length >= 3

View File

@ -6,7 +6,7 @@
name: secrets
- set_fact:
docker_image: "registry.webhosting.rug.nl/hpc/openstack-neutron-controller:latest"
docker_image: "registry.webhosting.rug.nl/hpc/openstack-neutron-controller-merlin:latest"
- name: pull docker image
docker_image:
@ -29,6 +29,7 @@
-e "NOVA_CONTROLLER_HOST={{ listen_ip | default(hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address']) }}"
-e "NOVA_PLACEMENT_PASSWORD={{ secrets['NOVA_PLACEMENT_PASSWORD'] }}"
-e "NOVA_PLACEMENT_USER=placement"
-e "OVERLAY_IP={{ overlay_ip }}"
-e "OS_PASSWORD={{ secrets['OS_PASSWORD'] }}"
-e "PHYSICAL_INTERFACE_MAPPINGS={{ physical_interface_mappings }}"
-e "RABBIT_PASSWORD={{ secrets['RABBIT_PASSWORD'] }}"

View File

@ -7,7 +7,7 @@
tags: vars
- set_fact:
docker_image: registry.webhosting.rug.nl/hpc/openstack-nova-compute:latest
docker_image: registry.webhosting.rug.nl/hpc/openstack-nova-compute-merlin:latest
tags: vars
- name: pull docker image

View File

@ -26,12 +26,12 @@ ExecStart=/usr/bin/docker run --name %n \
-e "NOVA_PLACEMENT_PASSWORD={{ secrets['NOVA_PLACEMENT_PASSWORD'] }}" \
-e "NOVA_PLACEMENT_USER=placement" \
-e "NOVA_USER=nova" \
-e "OVERLAY_IP={{ overlay_ip }}" \
-e "OS_PASSWORD={{ secrets['OS_PASSWORD'] }}" \
-e "PHYSICAL_INTERFACE_MAPPINGS={{ physical_interface_mappings }}" \
-e "RABBIT_HOST={{ hostvars[groups['rabbitmq'][0]]['listen_ip'] | default(hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address']) }}" \
-e "RABBIT_PASSWORD={{ secrets['RABBIT_PASSWORD'] }}" \
-e "RABBIT_USER=openstack" \
-e "AVAILABILITY_ZONE={{ ansible_nodename }}" \
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['listen_ip'] | default(hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address']) }} \
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['listen_ip'] | default(hostvars[groups['databases'][0]]['ansible_default_ipv4']['address']) }} \
--privileged \

View File

@ -1,15 +1,15 @@
---
- import_playbook: common.yml
- import_playbook: rabbitmq.yml
- import_playbook: memcached.yml
- import_playbook: mariadb.yml
- import_playbook: keystone.yml
- import_playbook: glance-controller.yml
- import_playbook: nova-controller.yml
- import_playbook: neutron-controller.yml
- import_playbook: cinder-controller.yml
- import_playbook: cinder-storage.yml
- import_playbook: nova-compute.yml
- import_playbook: horizon.yml
- import_playbook: heat.yml
- import_playbook: post-install.yml
- include: common.yml
- include: rabbitmq.yml
- include: memcached.yml
- include: mariadb.yml
- include: keystone.yml
- include: glance-controller.yml
- include: nova-controller.yml
- include: neutron-controller.yml
- include: cinder-controller.yml
- include: cinder-storage.yml
- include: nova-compute.yml
- include: horizon.yml
- include: heat.yml
#- include: post-install.yml