2016-06-27 15:57:29 +00:00
|
|
|
- hosts: kube-master
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-06-27 15:57:29 +00:00
|
|
|
pre_tasks:
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Download fuel-ccp
|
2016-07-08 12:23:00 +00:00
|
|
|
git:
|
|
|
|
repo: https://git.openstack.org/openstack/fuel-ccp
|
|
|
|
dest: /usr/local/src/fuel-ccp
|
|
|
|
version: master
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Upload ccp configs to master nodes
|
2016-06-27 15:57:29 +00:00
|
|
|
synchronize:
|
2016-06-30 14:12:26 +00:00
|
|
|
src: ../ccp/
|
2016-06-27 15:57:29 +00:00
|
|
|
dest: /root/ccp/
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-06-27 15:57:29 +00:00
|
|
|
tasks:
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Install CCP cli tool
|
|
|
|
shell: pip install -U fuel-ccp/
|
2016-06-27 15:57:29 +00:00
|
|
|
args:
|
2016-07-07 17:30:36 +00:00
|
|
|
chdir: /usr/local/src
|
2016-06-27 15:57:29 +00:00
|
|
|
creates: /usr/local/bin/mcp-microservices
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Get pods
|
|
|
|
shell: kubectl get pods
|
|
|
|
register: get_pod
|
|
|
|
run_once: true
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Get services
|
|
|
|
shell: kubectl get svc
|
|
|
|
register: get_svc
|
|
|
|
run_once: true
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Create registry pod
|
|
|
|
shell: kubectl create -f registry_pod.yaml
|
|
|
|
args:
|
|
|
|
chdir: /root/ccp
|
|
|
|
run_once: true
|
2016-07-12 15:56:40 +00:00
|
|
|
when: get_pod.stdout.find('registry') == -1
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Create registry svc
|
|
|
|
shell: kubectl create -f registry_svc.yaml
|
|
|
|
args:
|
|
|
|
chdir: /root/ccp
|
|
|
|
run_once: true
|
|
|
|
when: get_svc.stdout.find('registry') == -1
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-07 17:30:36 +00:00
|
|
|
- name: Fetch CCP images
|
2016-07-12 15:56:40 +00:00
|
|
|
shell: mcp-microservices --config-file=/root/ccp/ccp.conf fetch
|
2016-07-07 17:30:36 +00:00
|
|
|
run_once: true
|
2016-07-08 12:32:43 +00:00
|
|
|
|
2016-07-13 13:33:02 +00:00
|
|
|
# - name: Patch fuel-ccp-neutron
|
|
|
|
# run_once: true
|
|
|
|
# args:
|
|
|
|
# chdir: /root/microservices-repos/fuel-ccp-neutron
|
|
|
|
# shell: git fetch https://git.openstack.org/openstack/fuel-ccp-neutron {{ item }} && git cherry-pick FETCH_HEAD
|
|
|
|
# with_items:
|
|
|
|
# - "refs/changes/96/340496/6"
|
2016-07-12 16:56:41 +00:00
|
|
|
|
2016-07-04 13:51:35 +00:00
|
|
|
- name: Build CCP images
|
2016-07-12 15:56:40 +00:00
|
|
|
shell: mcp-microservices --config-file=/root/ccp/ccp.conf build
|
2016-07-04 13:51:35 +00:00
|
|
|
run_once: true
|
2016-07-08 12:32:43 +00:00
|
|
|
|
|
|
|
- hosts: k8s-cluster
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: Check number of built images
|
|
|
|
shell: test $(curl -s 127.0.0.1:31500/v2/_catalog | python -mjson.tool | grep mcp/ | wc -l) -ge 29
|