4 Commits

Author SHA1 Message Date
0c605af3ae Check if this role is deployed as part of the cluster
This makes it possible to deploy a galara cluster in one set of hosts
and a separate stand alone mariadb on another host.
2018-05-17 16:12:28 +02:00
ca6adb44f6 It should be include_playbook
... the replacement for impotrt for static includes, that is....
2018-04-04 11:28:16 +02:00
c0d50d7444 include is deprecated. 2018-03-22 09:21:22 +01:00
f8a3179b74 Ensure installation of same openstack client 2018-02-22 16:35:44 +01:00
11 changed files with 72 additions and 91 deletions

14
gcc-site.yml Normal file
View File

@ -0,0 +1,14 @@
---
- 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

38
merlin
View File

@ -1,39 +1,37 @@
[nova-compute]
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
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
[databases]
merlin-node011
merlin-node012
merlin-node013
merlin-managementnode001
merlin-managementnode002
merlin-managementnode003
[rabbitmq]
merlin-node011
merlin-node012
merlin-node013
merlin-managementnode001
merlin-managementnode002
merlin-managementnode003
[horizon]
merlin-node011
merlin-managementnode001
[memcached]
merlin-node011
merlin-managementnode001
[nova-controller]
merlin-node011
merlin-managementnode001
[keystone]
merlin-node011
merlin-managementnode001
[neutron-controller]
merlin-node011 physical_interface_mappings=provider:enp129s0f1 overlay_ip=172.23.43.11
merlin-managementnode001 physical_interface_mappings=provider:eno3
[heat]
merlin-node011
merlin-managementnode001
[glance-controller]
merlin-node011
merlin-managementnode001

View File

@ -1,39 +0,0 @@
[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

@ -16,7 +16,10 @@
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 network set --external 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 flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
- openstack keypair create --public-key /root/id_rsa.pub adminkey

View File

@ -5,7 +5,7 @@
- name: Passwordless sudo for admins
lineinfile: dest=/etc/sudoers line="%admin ALL=(ALL:ALL) NOPASSWD:ALL"
- include: users.yml
- import_tasks: users.yml
- name: common | install packages
apt: pkg={{ item }} state=latest update_cache=yes
@ -26,4 +26,4 @@
owner: root
group: root
- include: docker.yml
- import_tasks: docker.yml

View File

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

View File

@ -21,12 +21,14 @@
dest: /srv/mariadb/etc/mysql/conf.d/my.cnf
mode: 660
- name: Set galara.cnf on node if we have at least three nodes.
- name: >
Set galara.cnf on node if we have at least three nodes.
And we're part of the cluster.
template:
src: files/galera.cnf
dest: /srv/mariadb/etc/mysql/conf.d/galera.cnf
mode: 660
when: groups['databases'] | length >= 3
when: "'databases' in group_names and groups['databases'] | length >= 3"
# This mimics galera_new_cluster.sh
- name: Initialize a new cluster.
@ -47,7 +49,8 @@
name: mysql.service
state: started
when: groups['databases'] | length >= 3 and ansible_hostname == hostname_node0
when: "'databases' in group_names and groups['databases'] \
| length >= 3 and ansible_hostname == hostname_node0"
- name: install service file.
block:
@ -61,17 +64,22 @@
group: root
- name: Give the master node some time to initialize the cluster.
command: bash -c "sleep 60 && systemctl daemon-reload"
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"
- 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: groups['databases'] | length >= 3
when: "'databases' in group_names and groups['databases'] | length >= 3"

View File

@ -6,7 +6,7 @@
name: secrets
- set_fact:
docker_image: "registry.webhosting.rug.nl/hpc/openstack-neutron-controller-merlin:latest"
docker_image: "registry.webhosting.rug.nl/hpc/openstack-neutron-controller:latest"
- name: pull docker image
docker_image:
@ -29,7 +29,6 @@
-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-merlin:latest
docker_image: registry.webhosting.rug.nl/hpc/openstack-nova-compute:latest
tags: vars
- name: pull docker image

View File

@ -26,7 +26,6 @@ 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']) }}" \

View File

@ -1,15 +1,15 @@
---
- 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
- 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