added docker repo

This commit is contained in:
Egon Rijpkema 2017-07-31 13:21:03 +02:00
parent 2b3e8cebae
commit 1a78f649e8
14 changed files with 60 additions and 30 deletions

View File

@ -13,7 +13,7 @@ ExecStart=/usr/bin/docker run --name %n -v /srv/lib/cassandra:/var/lib/cassandra
-p 7000:7000 -p 7001:7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 \
-e CASSANDRA_BROADCAST_ADDRESS={{ansible_default_ipv4.address}} \
-e CASSANDRA_START_RPC=True \
{{run_options}} cassandra:3.10
cassandra:3.10
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +1,22 @@
# Build and install a docker image for glance.
---
- set_fact:
docker_image: webhost12.service.rug.nl/hpc/openstack-glance:latest
env_vars: >
-e "RABBIT_HOST={{ hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address'] }}"
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
-e "MYSQL_ROOT_PASSWORD=geheim"
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
-e "GLANCE_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
-e "GLANCE_USER=glance"
-e "GLANCE_PASSWORD=geheim"
- name: pull docker image
docker_image:
name: "{{ docker_image }}"
tags: pull
- name: Make build and persistent directories
file:
path: "{{ item }}"
@ -20,15 +37,8 @@
- name: Initialize database.
command: >
docker run --rm
-e "RABBIT_HOST={{ hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address'] }}"
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
-e "MYSQL_ROOT_PASSWORD=geheim"
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
-e "GLANCE_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
-e "GLANCE_USER=glance"
-e "GLANCE_PASSWORD=geheim"
/usr/bin/docker run --rm
{{ env_vars }}
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
hpc/openstack-glance /etc/bootstrap.sh

View File

@ -8,16 +8,8 @@ TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker rm -f %n
ExecStart=/usr/bin/docker run --name %n \
-e "RABBIT_HOST={{ hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address'] }}" \
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}" \
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}" \
-e "MYSQL_ROOT_PASSWORD=geheim" \
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}" \
-e "GLANCE_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}" \
-e "GLANCE_USER=glance" \
-e "GLANCE_PASSWORD=geheim" \
-p 9292:9292 \
hpc/openstack-glance
{{ env_vars | replace('\n', '') }} \
{{ docker_image }}
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +1,10 @@
# Run hpc/horizon
---
- name: pull docker image
docker_image:
name: webhost12.service.rug.nl/hpc/openstack-horizon:latest
tags: pull
- name: install service file.
template:
src: templates/horizon.service

View File

@ -13,7 +13,7 @@ ExecStart=/usr/bin/docker run --name %n \
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
-p 80:80 \
hpc/horizon
hpc/openstack-horizon
[Install]
WantedBy=multi-user.target

View File

@ -6,6 +6,11 @@
state: directory
mode: 0777
- name: pull keystone image
docker_image:
name: webhost12.service.rug.nl/hpc/openstack-keystone:latest
tags: pull
- name: install service file.
template:
src: templates/keystone.service

View File

@ -12,7 +12,7 @@ ExecStart=/usr/bin/docker run --name %n \
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}" \
-p 5000:5000 -p 35357:35357 \
-v /srv/keystone/fernet-keys:/etc/keystone/fernet-keys \
hpc/keystone
hpc/openstack-keystone
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +1,10 @@
# Build and install a docker image for neutron-controller.
---
- name: pull docker image
docker_image:
name: webhost12.service.rug.nl/hpc/openstack-neutron-controller:latest
tags: pull
- set_fact:
env_vars: >
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
@ -35,7 +40,7 @@
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}
--network host
hpc/neutroncontroller
hpc/openstack-neutron-controller
/etc/bootstrap.sh
tags: bootstrap

View File

@ -16,7 +16,7 @@ ExecStart=/usr/bin/docker run --name %n \
--privileged \
--network host \
-v /lib/modules:/lib/modules \
hpc/neutroncontroller /etc/run.sh
hpc/openstack-neutron-controller /etc/run.sh
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +1,10 @@
# Build and install a docker image for nova-controller.
---
- name: pull docker image
docker_image:
name: webhost12.service.rug.nl/hpc/openstack-nova-compute:latest
tags: pull
- name: install service file.
template:
src: templates/nova-compute.service

View File

@ -21,7 +21,11 @@ ExecStart=/usr/bin/docker run --name %n \
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}" \
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}" \
-e "MYSQL_ROOT_PASSWORD=geheim" \
-e "NEUTRON_CONTROLLER_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}" \
-e "NEUTRON_PASSWORD=geheim" \
-e "NEUTRON_USER=neutron" \
-e "NOVA_CONTROLLER_HOST={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}" \
-e "PROVIDER_INTERFACE_NAME={{ hostvars[groups['neutron-controller'][0]]['ansible_default_ipv4']['interface'] }}" \
-e "GLANCE_CONTROLLER_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}" \
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
@ -29,7 +33,8 @@ ExecStart=/usr/bin/docker run --name %n \
--privileged \
-v /var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock \
-v /srv/osdisks:/var/lib/nova/instances \
hpc/novacompute /etc/run.sh
--network host \
hpc/openstack-nova-compute /etc/run.sh
[Install]
WantedBy=multi-user.target

View File

@ -1,5 +1,10 @@
# Build and install a docker image for nova-controller.
---
- name: pull docker image
docker_image:
name: webhost12.service.rug.nl/hpc/openstack-nova-service:latest
tags: pull
- set_fact:
env_vars: >
-e "MY_IP={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
@ -35,7 +40,7 @@
/usr/bin/docker run --rm
{{ env_vars }}
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
hpc/novacontroller
hpc/openstack-nova-service
/etc/bootstrap.sh
tags: bootstrap

View File

@ -14,7 +14,7 @@ ExecStart=/usr/bin/docker run --name %n \
--privileged \
-p 8774:8774 \
-p 8778:8778 \
hpc/novacontroller /etc/run.sh
hpc/openstack-nova-service /etc/run.sh
[Install]
WantedBy=multi-user.target

View File

@ -1,8 +1,6 @@
---
- include: cassandra.yml
- include: common.yml
- include: database.yml
- include: dockerregistry.yml
- include: mariadb.yml
- include: glance-controller.yml
- include: horizon.yml
- include: keystone.yml