5 changed files with 131 additions and 1 deletions
@ -0,0 +1,42 @@ |
|||||
|
# Using this Ansible role from AWX / Ansible Tower |
||||
|
|
||||
|
Install the Tower CLI: |
||||
|
|
||||
|
```sh |
||||
|
sudo yum install python2-ansible-tower-cli |
||||
|
``` |
||||
|
|
||||
|
Review the [tower-assets.yaml](tower-assets.yaml) and adjust it to match your environment. |
||||
|
Search for those placeholders to replace: |
||||
|
|
||||
|
- YOUR_ACCESS_TOKEN |
||||
|
- CLIENT_ID |
||||
|
- CLIENT_SECRET |
||||
|
- SSO_HOST |
||||
|
- REALM |
||||
|
- TENANT |
||||
|
|
||||
|
Use the tower-cli to create the resources in Tower: |
||||
|
|
||||
|
```sh |
||||
|
tower-cli send -h ansible.app.itix.fr -u admin -p secret support/awx/tower-assets.yaml |
||||
|
``` |
||||
|
|
||||
|
You can now provision an API from your favourite CI/CD tool. For example, from Jenkins you could use: |
||||
|
|
||||
|
```groovy |
||||
|
def towerExtraVars = [ |
||||
|
git_repo: "https://github.com/nmasse-itix/rhte-api.git", |
||||
|
git_branch: "master", |
||||
|
openapi_file: "openapi-spec.yaml", |
||||
|
threescale_cicd_api_base_system_name: "event_api", |
||||
|
threescale_cicd_private_base_url: "https://echo-api.3scale.net", |
||||
|
threescale_cicd_api_environment_name: "prod", |
||||
|
threescale_cicd_wildcard_domain: "prod.app.openshift.test" |
||||
|
] |
||||
|
|
||||
|
ansibleTower towerServer: "tower", |
||||
|
inventory: "3scale", |
||||
|
jobTemplate: "Deploy an API to 3scale", |
||||
|
extraVars: JsonOutput.toJson(towerExtraVars) |
||||
|
``` |
||||
@ -0,0 +1,85 @@ |
|||||
|
- ask_variables_on_launch: true |
||||
|
asset_relation: |
||||
|
extra_credentials: [] |
||||
|
notification_templates_error: [] |
||||
|
notification_templates_success: [] |
||||
|
roles: |
||||
|
- name: Read |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Execute |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Admin |
||||
|
team: [] |
||||
|
user: [] |
||||
|
schedules: [] |
||||
|
survey_spec: {} |
||||
|
asset_type: job_template |
||||
|
name: Deploy an API to 3scale |
||||
|
playbook: support/awx/deploy-api.yml |
||||
|
inventory: 3scale |
||||
|
project: Deploy API to 3scale |
||||
|
verbosity: 1 |
||||
|
- asset_relation: |
||||
|
notification_templates_error: [] |
||||
|
notification_templates_success: [] |
||||
|
roles: |
||||
|
- name: Admin |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Read |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Use |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Update |
||||
|
team: [] |
||||
|
user: [] |
||||
|
schedules: [] |
||||
|
asset_type: project |
||||
|
description: Enable continuous deployment of an API to 3scale AMP |
||||
|
name: Deploy API to 3scale |
||||
|
organization: Default |
||||
|
scm_branch: master |
||||
|
scm_type: git |
||||
|
scm_update_cache_timeout: 60 |
||||
|
scm_update_on_launch: true |
||||
|
scm_url: https://github.com/nmasse-itix/threescale-cicd.git |
||||
|
- asset_relation: |
||||
|
group: |
||||
|
- hosts: |
||||
|
- TENANT-admin.3scale.net |
||||
|
name: threescale |
||||
|
sub_groups: [] |
||||
|
variables: '--- |
||||
|
|
||||
|
threescale_cicd_access_token: YOUR_ACCESS_TOKEN |
||||
|
|
||||
|
threescale_cicd_sso_issuer_endpoint: https://CLIENT_ID:CLIENT_SECRET@SSO_HOST/auth/realms/REALM' |
||||
|
host: |
||||
|
- name: TENANT-admin.3scale.net |
||||
|
inventory_source: [] |
||||
|
roles: |
||||
|
- name: Ad Hoc |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Admin |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Read |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Use |
||||
|
team: [] |
||||
|
user: [] |
||||
|
- name: Update |
||||
|
team: [] |
||||
|
user: [] |
||||
|
asset_type: inventory |
||||
|
name: 3scale |
||||
|
organization: Default |
||||
|
variables: '--- |
||||
|
|
||||
|
ansible_connection: local' |
||||
Loading…
Reference in new issue