c12s-kubespray/playbooks/ccp-build.yaml
2016-07-07 19:50:16 +02:00

45 lines
1.3 KiB
YAML

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