Browse Source

Work in progress

master
Nicolas Massé 9 years ago
parent
commit
b962cceaba
  1. 78
      roles/3scale/files/amp.json
  2. 6
      roles/3scale/files/get-default-templates.sh
  3. 7
      roles/3scale/tasks/main.yml

78
roles/3scale/files/amp.json

@ -285,11 +285,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -373,11 +369,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -470,11 +462,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -619,11 +607,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -750,11 +734,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -867,11 +847,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -963,11 +939,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -1145,11 +1117,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -1281,11 +1249,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -2007,11 +1971,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -2394,11 +2354,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -2613,11 +2569,7 @@
]
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
"triggers": []
}
},
{
@ -2630,11 +2582,7 @@
"strategy": {
"type": "Recreate"
},
"triggers": [
{
"type": "ConfigChange"
}
],
"triggers": [],
"replicas": 0,
"selector": {
"name": "system-mysql"

6
roles/3scale/files/get-default-templates.sh

@ -1,9 +1,9 @@
#!/bin/bash
#
# This script gets the original 3scale template, converts it to JSON and
# scale down the DeploymentConfig's replicas to 0.
# This script gets the original 3scale template, converts it to JSON,
# scales down the DeploymentConfig's replicas to 0 and disable triggers.
#
curl -s -o amp.yml https://raw.githubusercontent.com/3scale/3scale-amp-openshift-templates/2.0.0.GA/amp/amp.yml
yaml2json amp.yml |jq '(.objects[]|select(.kind== "DeploymentConfig").spec.replicas) |= 0' > amp.json
yaml2json amp.yml |jq '(.objects[]|select(.kind== "DeploymentConfig").spec.replicas) |= 0 | (.objects[]|select(.kind== "DeploymentConfig").spec.triggers) |= []' > amp.json

7
roles/3scale/tasks/main.yml

@ -14,14 +14,17 @@
- name: Get a list of existing projects
command: oc get projects -o name
register: oc_get_projects
changed_when: false
- name: Create a new project for 3scale
command: oc new-project "{{ threescale_options.project }}"
when: "project/" + threescale_options.project not in oc_get_projects.stdout_lines
when: '"project/" ~ threescale_options.project not in oc_get_projects.stdout_lines'
- name: Process the OpenShift Template and create the OpenShift objects for the hostpath-provisioner
- name: Process the OpenShift Template and create the OpenShift objects for the 3scale API Management Platform
shell: oc process -f "{{ threescale_options.template }}" -p "TENANT_NAME={{ threescale_options.tenant_name }}" -p "WILDCARD_DOMAIN={{ threescale_options.wildcard_domain }}" | oc create -f - -n "{{ threescale_options.project }}"
# TODO
- name: Get Admin Username
command: oc get dc system-app -n "{{ threescale_options.project }}" -o 'jsonpath={.spec.template.spec.containers[0].env[?(@.name=="USER_LOGIN")].value}'
register: username

Loading…
Cancel
Save