Added check for CCP images build

This commit is contained in:
Aleksandr Didenko 2016-07-08 14:32:43 +02:00
parent e6358d825e
commit 99db440287
2 changed files with 23 additions and 0 deletions

View file

@ -1,42 +1,60 @@
- hosts: kube-master - hosts: kube-master
pre_tasks: pre_tasks:
- name: Download fuel-ccp - name: Download fuel-ccp
git: git:
repo: https://git.openstack.org/openstack/fuel-ccp repo: https://git.openstack.org/openstack/fuel-ccp
dest: /usr/local/src/fuel-ccp dest: /usr/local/src/fuel-ccp
version: master version: master
- name: Upload ccp configs to master nodes - name: Upload ccp configs to master nodes
synchronize: synchronize:
src: ../ccp/ src: ../ccp/
dest: /root/ccp/ dest: /root/ccp/
tasks: tasks:
- name: Install CCP cli tool - name: Install CCP cli tool
shell: pip install -U fuel-ccp/ shell: pip install -U fuel-ccp/
args: args:
chdir: /usr/local/src chdir: /usr/local/src
creates: /usr/local/bin/mcp-microservices creates: /usr/local/bin/mcp-microservices
- name: Get pods - name: Get pods
shell: kubectl get pods shell: kubectl get pods
register: get_pod register: get_pod
run_once: true run_once: true
- name: Get services - name: Get services
shell: kubectl get svc shell: kubectl get svc
register: get_svc register: get_svc
run_once: true run_once: true
- name: Create registry pod - name: Create registry pod
shell: kubectl create -f registry_pod.yaml shell: kubectl create -f registry_pod.yaml
args: args:
chdir: /root/ccp chdir: /root/ccp
run_once: true run_once: true
- name: Create registry svc - name: Create registry svc
shell: kubectl create -f registry_svc.yaml shell: kubectl create -f registry_svc.yaml
args: args:
chdir: /root/ccp chdir: /root/ccp
run_once: true run_once: true
when: get_svc.stdout.find('registry') == -1 when: get_svc.stdout.find('registry') == -1
- name: Fetch CCP images - name: Fetch CCP images
shell: mcp-microservices --config-file=/root/ccp/ccp.conf fetch shell: mcp-microservices --config-file=/root/ccp/ccp.conf fetch
run_once: true run_once: true
- name: Build CCP images - name: Build CCP images
shell: mcp-microservices --config-file=/root/ccp/ccp.conf build shell: mcp-microservices --config-file=/root/ccp/ccp.conf build
run_once: true run_once: true
- 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

View file

@ -1,14 +1,19 @@
- hosts: kube-master - hosts: kube-master
pre_tasks: pre_tasks:
- name: Rsync CCP configs - name: Rsync CCP configs
synchronize: synchronize:
src: ../ccp/ src: ../ccp/
dest: /root/ccp/ dest: /root/ccp/
tasks: tasks:
- name: Get namespaces - name: Get namespaces
shell: kubectl get namespace shell: kubectl get namespace
register: get_ns register: get_ns
run_once: true run_once: true
- name: Deploy CCP - name: Deploy CCP
shell: mcp-microservices --config-file=/root/ccp/ccp.conf deploy shell: mcp-microservices --config-file=/root/ccp/ccp.conf deploy
args: args: