This repository contains the Ansible scripts for installing and configuring WSO2 API Management.
This is a template for other projects
- Ubuntu 16.04 or higher
- CentOS 7
- Ansible 2.5 or higher
.
├── dev
│ ├── group_vars
│ │ ├── apim-analytics.yml
│ │ ├── apim-is-as-km.yml
│ │ └── apim.yml
│ ├── host_vars
│ │ ├── apim_1.yml
│ │ ├── apim-analytics-dashboard_1.yml
│ │ ├── apim-analytics-worker_1.yml
│ │ ├── apim-gateway_1.yml
│ │ ├── apim-is-as-km_1.yml
│ │ ├── apim-km_1.yml
│ │ ├── apim-publisher_1.yml
│ │ ├── apim-devportal_1.yml
│ │ └── apim-tm_1.yml
│ └── inventory
├── docs
│ ├── images
│ │ ├── API-M-single-node-deployment.png
│ │ ├── P-H-1.png
│ │ ├── P-H-2.png
│ │ ├── P-H-3.png
│ │ ├── P-M-1.png
│ │ └── P-S-1.png
│ ├── Pattern_1.md
│ ├── Pattern_2.md
│ ├── Pattern_3.md
│ ├── Pattern_4.md
│ └── Pattern_5.md
├── files
│ ├── lib
│ │ ├── amazon-corretto-8.242.08.1-linux-x64.tar.gz
│ └── packs
│ │ ├── wso2am-3.1.0.zip
│ │ ├── wso2am-analytics-3.1.0.zip
│ │ └── wso2is-km-5.10.0.zip
│ ├── system
│ │ └── etc
│ │ ├── security
│ │ │ └── limits.conf
│ │ └── sysctl.conf
│ └── misc
├── issue_template.md
├── LICENSE
├── pull_request_template.md
├── README.md
├── roles
│ ├── apim
│ │ ├── tasks
│ │ └── templates
│ ├── apim-analytics-dashboard
│ │ ├── tasks
│ │ └── templates
│ ├── apim-analytics-worker
│ │ ├── tasks
│ │ └── templates
│ ├── apim-gateway
│ │ ├── tasks
│ │ └── templates
│ ├── apim-is-as-km
│ │ ├── tasks
│ │ └── templates
│ ├── apim-km
│ │ ├── tasks
│ │ └── templates
│ ├── apim-publisher
│ │ ├── tasks
│ │ └── templates
│ ├── apim-devportal
│ │ ├── tasks
│ │ └── templates
│ ├── apim-tm
│ │ ├── tasks
│ │ └── templates
│ └── common
│ └── tasks
├── scripts
│ ├── update.sh
│ └── update_README.md
└── site.yml
Packs could be either copied to a local directory, or downloaded from a remote location.
Copy the following files to files/packs directory.
- WSO2 API Manager 3.1.0 package
- WSO2 API Manager Analytics 3.1.0 package
- WSO2 API Manager Identity Server as Key Manager 5.10.0 package
Copy the following files to files/lib directory.
Copy the miscellaneous files to files/misc directory. To enable file copying, uncomment the misc_file_list in the yaml files under group_vars and add the miscellaneous files to the list.
In group_vars, change the values of the following variables in all groups:
- The value of
pack_locationshould be changed from "local" to "remote" - The value of
remote_jdkshould be changed to the URL in which the JDK should be downloaded from, and remove it as a comment. - The value of
remote_packshould be changed to the URL in which the package should be downloaded from, and remove it as a comment.
The existing Ansible scripts contain the configurations to set-up a single node WSO2 API Manager pattern. In order to deploy the pattern, you need to replace the [ip_address] and [ssh_user] given in the inventory file under dev folder by the IP of the location where you need to host the API Manager. An example is given below.
[apim]
apim_1 ansible_host=172.28.128.4 ansible_user=vagrant
Update the hostname in dev/host_vars/apim_1.yml with ansible_host, 172.28.128.4
Run the following command to run the scripts.
ansible-playbook -i dev site.yml
If you need to alter the configurations given, please change the parameterized values in the yaml files under group_vars and host_vars.
The templates that are used by the Ansible scripts are in j2 format in-order to enable parameterization.
The deployment.toml.j2 file is added under roles/apim/templates/carbon-home/repository/conf/, in order to enable customizations. You can add any other customizations to custom.yml under tasks of each role as well.
Uncomment the following line in main.yml under the role you want to customize.
- import_tasks: custom.yml
Add the configurations to the custom.yml. A sample is given below.
- name: "Copy custom file"
template:
src: path/to/example/file/example.xml.j2
dest: destination/example.xml.j2
when: "(inventory_hostname in groups['am'])"
Follow the steps mentioned under docs directory to customize/create new Ansible scripts and deploy the recommended patterns.
System configurations can be changed through Ansible to optimize OS level performance. Performance tuning can be enabled by changing enable_performance_tuning in dev/group_vars/apim.yml to true.
System files that will be updated when performance tuning are enabled is available in files/system. Update the configuration values according to the requirements of your deployment.
The master branch of this repository contains the latest product version with the latest Ansible version. The Ansible resources for previous Ansible versions can be found in the branches. The following is an example.
Branch name: 3.0.x