-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy-ric.yml
83 lines (73 loc) · 2.77 KB
/
deploy-ric.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
- name: Deploy RIC on OCP Playbook
hosts: localhost
tasks:
- name: Load sctp config and hostpath config, then install helm
shell: |
curl -o load-sctp-module.yaml https://raw.githubusercontent.com/xphyr/ocp-ric/master/load-sctp-module.yaml
oc create -f load-sctp-module.yaml
curl -o seconfig_hostpath.yaml https://raw.githubusercontent.com/xphyr/ocp-ric/master/seconfig_hostpath.yaml
oc create -f seconfig_hostpath.yaml
curl -o helm-v2.17.0-linux-amd64.tar.gz https://get.helm.sh/helm-v2.17.0-linux-amd64.tar.gz
tar -zxvf helm-v2.17.0-linux-amd64.tar.gz
sudo mv linux-amd64/helm /usr/local/bin/helm
- name: Check if directory exists
stat:
path: ocp-ric
register: dir_to_delete
- name: Delete existing directory
shell: |
rm -Rf ocp-ric
when: dir_to_delete.stat.exists and dir_to_delete.stat.isdir
- name: Clone the git repo
command: git clone https://github.com/xphyr/ocp-ric.git
- name: update repo
shell: |
git submodule update --init --recursive --remote
args:
chdir: ocp-ric/
- name: create tiller project and initialize helm
shell: |
oc new-project tiller
oc project tiller
helm init --client-only
environment:
TILLER_NAMESPACE: tiller
args:
chdir: ocp-ric/
- name: download tiller template
shell: |
curl -o tiller-template.yaml https://raw.githubusercontent.com/xphyr/ocp-ric/master/tiller-template.yaml
args:
chdir: ocp-ric/
- name: create tiller process
shell: |
oc process -f tiller-template.yaml -p TILLER_NAMESPACE="${TILLER_NAMESPACE}" -p HELM_VERSION=v2.17.0 | oc create -f -
environment:
TILLER_NAMESPACE: tiller
ignore_errors: True
args:
chdir: ocp-ric/
- name: wait for helm to come up
shell: helm version
register: helm_version
until: helm_version.stdout.find("Client") != -1 and helm_version.stdout.find("Server") != -1
delay: 5
retries: 10
environment:
TILLER_NAMESPACE: tiller
- name: replace storage class
replace:
path: ocp-ric/dep/ric-dep/RECIPE_EXAMPLE/example_recipe.yaml
regexp: 'storageClassName: local-storage'
replace: "storageClassName: ocs-storagecluster-ceph-rbd"
- name: give admin access to service account, patch the ric files and deploy
shell: |
oc project ricplt
oc adm policy add-cluster-role-to-user cluster-admin "system:serviceaccount:${TILLER_NAMESPACE}:tiller"
patches/apply-ric-patch.sh
dep/bin/deploy-ric-platform dep/RECIPE_EXAMPLE/PLATFORM/example_recipe.yaml
environment:
TILLER_NAMESPACE: tiller
args:
chdir: ocp-ric/