You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
7 years ago | |
|---|---|---|
| .. | ||
| roles | 7 years ago | |
| Dockerfile | 7 years ago | |
| README.md | 7 years ago | |
| ansible.cfg | 7 years ago | |
| deploy-api.yaml | 7 years ago | |
| install.yaml | 7 years ago | |
| openshift-template.yaml | 7 years ago | |
README.md
Using this Ansible role from Docker
You can use this Ansible role as a container image and provision an API in 3scale very quickly.
You would first need to provision your 3scale Admin Portal hostname, access token and optionally the Red Hat SSO Issuer Endpoint in the same format as a Kubernetes secret:
mkdir -p /tmp/secrets
cat > /tmp/secrets/hostname <<EOF
TENANT-admin.3scale.net
EOF
cat > /tmp/secrets/access_token <<EOF
1234..5678
EOF
If your API is secured with OpenID Connect, you will need to provision the Red Hat SSO Issuer Endpoint as well:
cat > /tmp/secrets/sso_issuer_endpoint <<EOF
https://CLIENT_ID:CLIENT_SECRET@HOSTNAME/auth/realms/REALM
EOF
You can then run this Ansible role as a Docker container:
docker run -it --rm --name threescale-cicd -v /tmp/secrets:/tmp/secrets:ro docker.io/nmasse/threescale-cicd:stable -e git_repository=https://github.com/nmasse-itix/rhte-api.git -e git_ref=master -e threescale_cicd_openapi_file=openapi-spec.yaml -e threescale_cicd_api_base_system_name=echo-api -e threescale_cicd_private_base_url=https://echo-api.3scale.net
This command is composed of the following arguments:
-itwill run the Ansible command interactively--rmwill remove the container once finished--name threescale-cicdwill give a friendly name to the created container-v /tmp/secrets:/tmp/secrets:rowill mount the secrets created above inside the containerdocker.io/nmasse/threescale-cicd:stableis the name of the pre-built docker image.stableis the latest released version.masteris the development version. You can also target a specific version with for instance1.0.0.-e git_repository=https://github.com/nmasse-itix/rhte-api.gitwill checkout the forementioned GIT repository to extract the OpenAPI Specification file.-e git_ref=masterwill checkout this specific branch or tag of the GIT repository.-e threescale_cicd_openapi_file=openapi-spec.yamlsets the path to the OpenAPI Specification file inside the GIT repository.-e threescale_cicd_api_base_system_name=echo-apisets the base name that will be used to generate the 3scale system_name.-e threescale_cicd_private_base_url=https://echo-api.3scale.netsets the 3scale Private Base URL.
If your GIT repository is already checked out somewhere, you can re-use your
local copy by removing the -e git_* arguments and mounting your GIT repository
under /opt/ansible/threescale-cicd/support/docker/api.
docker run -it --rm --name threescale-cicd -v /path/to/git:/opt/ansible/threescale-cicd/support/docker/api:ro -v /tmp/secrets:/tmp/secrets:ro docker.io/nmasse/threescale-cicd:stable -e threescale_cicd_openapi_file=path/to/openapi-spec.yaml -e threescale_cicd_api_base_system_name=echo-api -e threescale_cicd_private_base_url=https://echo-api.3scale.net