Browse Source

improve jenkins doc + awx support

pull/50/head
Nicolas Massé 7 years ago
parent
commit
466173582f
  1. 42
      support/awx/README.md
  2. 2
      support/awx/deploy-api.yml
  3. 85
      support/awx/tower-assets.yaml
  4. 1
      support/jenkins/Jenkinsfile
  5. 2
      support/jenkins/README.md

42
support/awx/README.md

@ -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)
```

2
support/awx/deploy-api.yml

@ -1,6 +1,6 @@
--- ---
- name: Deploy an API to a 3scale SaaS instance, with self-managed APIcasts - name: Deploy an API to 3scale
hosts: threescale hosts: threescale
gather_facts: no gather_facts: no
pre_tasks: pre_tasks:

85
support/awx/tower-assets.yaml

@ -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'

1
support/jenkins/Jenkinsfile

@ -4,6 +4,7 @@
* This Jenkins Pipeline depends on the following plugins : * This Jenkins Pipeline depends on the following plugins :
* - Credentials Binding (https://plugins.jenkins.io/credentials-binding) * - Credentials Binding (https://plugins.jenkins.io/credentials-binding)
* - Ansible (https://plugins.jenkins.io/ansible) * - Ansible (https://plugins.jenkins.io/ansible)
* - Ansi Color (https://plugins.jenkins.io/ansicolor)
*/ */
pipeline { pipeline {

2
support/jenkins/README.md

@ -37,6 +37,8 @@ oc logs -f bc/jenkins-ansible-slave
- Go to the **Available** tab - Go to the **Available** tab
- In the **Filter** text field, type `Ansible` - In the **Filter** text field, type `Ansible`
- In the list, find the **Ansible plugin** and check its box in the **Enabled** column - In the list, find the **Ansible plugin** and check its box in the **Enabled** column
- In the **Filter** text field, type `Ansi Color`
- In the list, find the **Ansi Color** and check its box in the **Enabled** column
- Click **Install without restart** - Click **Install without restart**
## Create the pipeline that calls Ansible ## Create the pipeline that calls Ansible

Loading…
Cancel
Save