aboutsummaryrefslogtreecommitdiffstats
path: root/util/docker-compose/roles/osa
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-11-07 15:30:51 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-12-21 15:35:12 +0800
commita360411cb8c775dffa24a4157cec2b566cbde6f3 (patch)
tree400e879a6f6779c294d7f2113c05b29d5578cff3 /util/docker-compose/roles/osa
parent4074d39e93d7e7697dd2aaad2e08433ca0a60221 (diff)
Add compass-docker-compose
1. Add ansible for docker compose containerized compass 2. deploy/conf/compass.conf no longer specify image tags for runtime. build.yaml now is added into compass tarball to be the only place determine image tags 3. This patch is based on patch: https://gerrit.opnfv.org/gerrit/#/c/47393/ use merged compass-tasks 4. Tempoarily using private docker repo for compass-tasks. Switch to opnfv repo when patch https://gerrit.opnfv.org/gerrit/#/c/47329/ is merged 5. Modify ansible callback module accrodingly Change-Id: I0728a9002a1cc7804c9e8f13bd1afdccb684a159 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'util/docker-compose/roles/osa')
-rwxr-xr-xutil/docker-compose/roles/osa/files/cinder.yml13
-rwxr-xr-xutil/docker-compose/roles/osa/tasks/main.yml48
2 files changed, 61 insertions, 0 deletions
diff --git a/util/docker-compose/roles/osa/files/cinder.yml b/util/docker-compose/roles/osa/files/cinder.yml
new file mode 100755
index 00000000..3a39935a
--- /dev/null
+++ b/util/docker-compose/roles/osa/files/cinder.yml
@@ -0,0 +1,13 @@
+---
+# This file contains an example to show how to set
+# the cinder-volume service to run in a container.
+#
+# Important note:
+# When using LVM or any iSCSI-based cinder backends, such as NetApp with
+# iSCSI protocol, the cinder-volume service *must* run on metal.
+# Reference: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1226855
+
+container_skel:
+ cinder_volumes_container:
+ properties:
+ is_metal: true
diff --git a/util/docker-compose/roles/osa/tasks/main.yml b/util/docker-compose/roles/osa/tasks/main.yml
new file mode 100755
index 00000000..7b868908
--- /dev/null
+++ b/util/docker-compose/roles/osa/tasks/main.yml
@@ -0,0 +1,48 @@
+---
+- name: install packege
+ shell: |
+ docker exec compass-tasks bash -c \
+ "yum upgrade -y; \
+ yum install https://rdoproject.org/repos/openstack-ocata/rdo-release-ocata.rpm -y; \
+ yum install git ntp ntpdate openssh-server python-devel sudo '@Development Tools' -y"
+
+- name: git clone openstack-ansible
+ shell: |
+ docker exec compass-tasks bash -c \
+ "rm -rf /opt/openstack-ansible; \
+ git clone https://git.openstack.org/openstack/openstack-ansible /opt/openstack-ansible"
+
+- name: change openstack-ansible to ocata branch
+ shell: |
+ docker exec compass-tasks bash -c \
+ "cd /opt/openstack-ansible; \
+ git checkout -b ocata remotes/origin/stable/ocata"
+
+- name: copy /opt/openstack-ansible/etc/openstack_deploy to /etc/openstack_deploy
+ shell: |
+ docker exec compass-tasks bash -c \
+ "rm -rf /etc/openstack_deploy; \
+ /bin/cp -rf /opt/openstack-ansible/etc/openstack_deploy /etc/openstack_deploy"
+
+- name: bootstrap
+ shell: |
+ docker exec compass-tasks bash -c \
+ "cd /opt/openstack-ansible; \
+ scripts/bootstrap-ansible.sh; \
+ rm /usr/local/bin/ansible-playbook -f"
+
+- name: generate password token
+ shell: |
+ docker exec compass-tasks bash -c \
+ " cd /opt/openstack-ansible/scripts/; \
+ python pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml"
+
+- name: copy cinder file
+ copy:
+ src: cinder.yml
+ dest: "{{ docker_compose_dir }}/cinder.yml"
+
+- name: copy file to docker
+ shell: |
+ docker cp "{{ docker_compose_dir }}/cinder.yml" \
+ compass-tasks:/etc/openstack_deploy/env.d/cinder.yml;