From 240a1f22f3510f6c37b75f43075c128ba843046d Mon Sep 17 00:00:00 2001 From: Wim Nap Date: Fri, 13 Apr 2018 16:19:17 +0200 Subject: [PATCH] git push --set-upstream origin merlin --- hosts-openstack03 | 26 +++++++++ merlin | 54 ++++++++++++------- merlinsdn | 37 +++++++++++++ nuke.yml | 5 -- .../files/ceph.client.volumes.keyring | 9 ++++ roles/cinder-storage/files/ceph.conf | 2 + roles/cinder-storage/files/uuid | 1 + roles/cinder-storage/tasks/main.yml | 18 ++++++- .../templates/cinder-storage.service | 7 +-- .../files/ceph.client.images.keyring | 9 ++++ roles/glance-controller/tasks/main.yml | 12 +++-- .../templates/glance.service | 2 +- .../files/ceph.client.nova.keyring | 8 +++ roles/nova-compute/files/uuid | 1 + roles/nova-compute/tasks/ceph.conf | 2 + roles/nova-compute/tasks/main.yml | 21 ++++++++ 16 files changed, 179 insertions(+), 35 deletions(-) create mode 100644 hosts-openstack03 create mode 100644 merlinsdn create mode 100644 roles/cinder-storage/files/ceph.client.volumes.keyring create mode 100644 roles/cinder-storage/files/ceph.conf create mode 100644 roles/cinder-storage/files/uuid create mode 100644 roles/glance-controller/files/ceph.client.images.keyring create mode 100644 roles/nova-compute/files/ceph.client.nova.keyring create mode 100644 roles/nova-compute/files/uuid create mode 100644 roles/nova-compute/tasks/ceph.conf diff --git a/hosts-openstack03 b/hosts-openstack03 new file mode 100644 index 0000000..514a464 --- /dev/null +++ b/hosts-openstack03 @@ -0,0 +1,26 @@ +[databases] +openstack03.gcc.rug.nl + +[keystone] +openstack03.gcc.rug.nl + +[glance-controller] +openstack03.gcc.rug.nl + +[horizon] +openstack03.gcc.rug.nl + +[rabbitmq] +openstack03.gcc.rug.nl + +[memcached] +openstack03.gcc.rug.nl + +[neutron-controller] +openstack03.gcc.rug.nl + +[nova-controller] +openstack03.gcc.rug.nl + +[nova-compute] +openstack03.gcc.rug.nl diff --git a/merlin b/merlin index 13500c7..d39eb59 100644 --- a/merlin +++ b/merlin @@ -1,39 +1,53 @@ [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:enp5s0f1.1064 overlay_ip=172.23.43.102 +merlin-managementnode003 physical_interface_mappings=provider:enp5s0f1.1064 overlay_ip=172.23.43.103 +merlin-node001 physical_interface_mappings=provider:enp130s0f0.1064 overlay_ip=172.23.43.1 +merlin-node002 physical_interface_mappings=provider:enp130s0f0.1064 overlay_ip=172.23.43.2 +merlin-node003 physical_interface_mappings=provider:enp130s0f0.1064 overlay_ip=172.23.43.3 +merlin-node004 physical_interface_mappings=provider:enp130s0f0.1064 overlay_ip=172.23.43.4 +merlin-node005 physical_interface_mappings=provider:enp130s0f0.1064 overlay_ip=172.23.43.5 [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:enp5s0f1.1064 overlay_ip=172.23.43.101 [heat] -merlin-node011 +merlin-managementnode001 [glance-controller] -merlin-node011 +merlin-managementnode002 + +[cinder-controller] +merlin-managementnode002 + +[cinder-storage] +merlin-managementnode002 +merlin-managementnode003 +merlin-node001 +merlin-node002 +merlin-node003 +merlin-node004 +merlin-node005 + + diff --git a/merlinsdn b/merlinsdn new file mode 100644 index 0000000..de64a30 --- /dev/null +++ b/merlinsdn @@ -0,0 +1,37 @@ +[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 + +[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:eno3 + +[heat] +merlin-managementnode001 + +[glance-controller] +merlin-managementnode001 diff --git a/nuke.yml b/nuke.yml index 67ec9c7..19c36e4 100644 --- a/nuke.yml +++ b/nuke.yml @@ -14,8 +14,3 @@ - name: remove volumes shell: "rm -rf /srv" -- hosts: cinder-storage - become: True - tasks: - - name: wipe cinder storage. - shell: "dd if=/dev/zero of={{ storage_volume }} bs=1M count=1 && sync" diff --git a/roles/cinder-storage/files/ceph.client.volumes.keyring b/roles/cinder-storage/files/ceph.client.volumes.keyring new file mode 100644 index 0000000..b7c6912 --- /dev/null +++ b/roles/cinder-storage/files/ceph.client.volumes.keyring @@ -0,0 +1,9 @@ +$ANSIBLE_VAULT;1.1;AES256 +39313161646365373665646331613930316437363735326262376531636166346138303139613138 +3361353633616136303365646165643339333130393031380a373934636436626336326436306666 +34316532333165346139633239313930326238333134633365666138326338386632373937343335 +3262383863653136300a393464646365623763663063303936646462313764633736613562633661 +62313961626165363761656363393538396461653936353932303137626435626161316239623338 +65656132353136656430613462663466616432643761303366396461653066616162366666356533 +39386261623861323861633739343237386266306264356436666430313531303238636235393665 +31396533306261393835 diff --git a/roles/cinder-storage/files/ceph.conf b/roles/cinder-storage/files/ceph.conf new file mode 100644 index 0000000..5edf814 --- /dev/null +++ b/roles/cinder-storage/files/ceph.conf @@ -0,0 +1,2 @@ +[client.volumes] +keyring = /etc/ceph/ceph.client.volumes.keyring diff --git a/roles/cinder-storage/files/uuid b/roles/cinder-storage/files/uuid new file mode 100644 index 0000000..6171dc5 --- /dev/null +++ b/roles/cinder-storage/files/uuid @@ -0,0 +1 @@ +d0db6ba7-a0c9-4da6-b0bc-aa7846325333 diff --git a/roles/cinder-storage/tasks/main.yml b/roles/cinder-storage/tasks/main.yml index e65f906..5b45295 100644 --- a/roles/cinder-storage/tasks/main.yml +++ b/roles/cinder-storage/tasks/main.yml @@ -6,6 +6,9 @@ name: secrets tags: vars +#- command: uuidgen +# register: uuid + - set_fact: docker_image: registry.webhosting.rug.nl/hpc/openstack-cinder-storage:latest env_vars: > @@ -36,6 +39,7 @@ with_items: - /srv/cinder-storage - /srv/cinder-storage/root + - /srv/cinder-storage/etc/ceph - name: initial setup command: > @@ -43,10 +47,22 @@ --privileged {{ env_vars }} -v /srv/cinder-storage/root:/root \ - -v "{{ storage_volume }}":/dev/cinder_storage_volume \ {{ docker_image }} /etc/bootstrap.sh tags: bootstrap +- name: copy ceph-client configurationfile + copy: + src: files/ceph.conf + dest: /srv/cinder-storage/etc/ceph/ceph.conf + mode: 644 + +- name: copy ceph-client-keyring + copy: + src: files/ceph.client.volumes.keyring + dest: /srv/cinder-storage/etc/ceph/ceph.client.volumes.keyring + mode: 644 + + - name: install service file. template: src: templates/cinder-storage.service diff --git a/roles/cinder-storage/templates/cinder-storage.service b/roles/cinder-storage/templates/cinder-storage.service index 7949903..b938c07 100644 --- a/roles/cinder-storage/templates/cinder-storage.service +++ b/roles/cinder-storage/templates/cinder-storage.service @@ -11,11 +11,12 @@ 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 /dev/cinder-volumes/:/dev/cinder-volumes \ -v /srv/cinder-storage/root:/root \ -v "{{ storage_volume }}":/dev/cinder_storage_volume \ - -v "/dev/lvm":/dev/lvm \ - -v "/srv/cinder-storage/volumes/:/var/lib/cinder/volumes/" \ + -v /dev/lvm:/dev/lvm \ + -v /srv/cinder-storage/volumes/:/var/lib/cinder/volumes/ \ + -v /srv/cinder-storage/etc/ceph:/etc/ceph -p 8777:8776 \ -p 3260:3260 \ {{ docker_image }} diff --git a/roles/glance-controller/files/ceph.client.images.keyring b/roles/glance-controller/files/ceph.client.images.keyring new file mode 100644 index 0000000..935455a --- /dev/null +++ b/roles/glance-controller/files/ceph.client.images.keyring @@ -0,0 +1,9 @@ +$ANSIBLE_VAULT;1.1;AES256 +38396565316335323234336366643364636639306234383033383664383131343861326231633437 +3164323532393735663065313036316664623065383466310a393665393238323265316464393338 +35303535306434363538303032323366353138303363386463313364313864663535386138323634 +3138393163353063650a386532356566396636636365343065343934396163663732663965343038 +63343539643964656538396664633235636639356532616530613838613839623830396565656538 +62613236643632346539613036383230653431643733343737626666633532613030366462326430 +63303339373563366633363130363361643731303030323635323832333165363439623831316636 +64613533313664383164 diff --git a/roles/glance-controller/tasks/main.yml b/roles/glance-controller/tasks/main.yml index 4b8cbdc..7db1376 100644 --- a/roles/glance-controller/tasks/main.yml +++ b/roles/glance-controller/tasks/main.yml @@ -6,7 +6,7 @@ name: secrets - set_fact: - docker_image: registry.webhosting.rug.nl/hpc/openstack-glance:latest + docker_image: registry.webhosting.rug.nl/hpc/openstack-glance-merlin:latest env_vars: > -e "GLANCE_HOST={{ listen_ip | default(hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address']) }}" -e "GLANCE_PASSWORD={{ secrets['GLANCE_PASSWORD'] }}" @@ -20,10 +20,11 @@ -e "RABBIT_PASSWORD={{ secrets['RABBIT_PASSWORD'] }}" -e "RABBIT_USER=openstack" -- name: pull docker image - docker_image: - name: "{{ docker_image }}" - tags: pull + +#- name: pull docker image +# docker_image: +# name: "{{ docker_image }}" +# tags: pull - name: Make build and persistent directories file: @@ -33,6 +34,7 @@ with_items: - /srv/glance - /srv/glance/root + - /srv/glance/etc/ceph - name: install service file. template: diff --git a/roles/glance-controller/templates/glance.service b/roles/glance-controller/templates/glance.service index 71ccc40..51dbffa 100644 --- a/roles/glance-controller/templates/glance.service +++ b/roles/glance-controller/templates/glance.service @@ -11,7 +11,7 @@ ExecStartPre=-/usr/bin/docker rm %n ExecStart=/usr/bin/docker run --name %n \ {{ env_vars | replace('\n', '') }} \ -v /srv/glance/root:/root \ - -v /var/lib/glance/images:/var/lib/glance/images \ + -v /srv/glance/etc/ceph:/etc/ceph \ -p 9292:9292 \ {{ docker_image }} diff --git a/roles/nova-compute/files/ceph.client.nova.keyring b/roles/nova-compute/files/ceph.client.nova.keyring new file mode 100644 index 0000000..71e95d6 --- /dev/null +++ b/roles/nova-compute/files/ceph.client.nova.keyring @@ -0,0 +1,8 @@ +$ANSIBLE_VAULT;1.1;AES256 +35383561643837376265356534363538386266646466313034383231313261343566626338613433 +3464373930663738316366383835336235636137356431390a626334343661353733616366633963 +33306166646465356531666364656236633766653639393636396234663538373136373266353136 +3433626231323638300a306437383862316463363533373131343561303934326135663532656630 +38616139373964313963326539346338353664613035633436326433343835343030653936363836 +65313537623937663438663734323265323634376238373761626236353665613931616566306536 +343334346138313539333338336663343863 diff --git a/roles/nova-compute/files/uuid b/roles/nova-compute/files/uuid new file mode 100644 index 0000000..cea6dd9 --- /dev/null +++ b/roles/nova-compute/files/uuid @@ -0,0 +1 @@ +b5044271-1918-4070-822c-f19ed14d7494 diff --git a/roles/nova-compute/tasks/ceph.conf b/roles/nova-compute/tasks/ceph.conf new file mode 100644 index 0000000..2e6fecd --- /dev/null +++ b/roles/nova-compute/tasks/ceph.conf @@ -0,0 +1,2 @@ +[client.nova] +keyring = /etc/ceph/ceph.client.nova.keyring diff --git a/roles/nova-compute/tasks/main.yml b/roles/nova-compute/tasks/main.yml index 6d090a4..a8fb019 100644 --- a/roles/nova-compute/tasks/main.yml +++ b/roles/nova-compute/tasks/main.yml @@ -16,6 +16,27 @@ force: True tags: pull +- name: Make build and persistent directories + file: + path: "{{ item }}" + state: directory + mode: 0777 + with_items: + - /srv/nova-compute + - /srv/nova-compute/etc/ceph + +- name: copy ceph-client configurationfile + copy: + src: files/ceph.conf + dest: /srv/nova-compute/etc/ceph/ceph.conf + mode: 644 + +- name: copy ceph-client-keyring + copy: + src: files/ceph.client.nova.keyring + dest: /srv/nova-compute/etc/ceph/ceph.client.nova.keyring + mode: 644 + - name: install service file. template: src: templates/nova-compute.service