{"id":13763235,"url":"https://github.com/wso2/ansible-apim","last_synced_at":"2025-04-05T17:03:49.165Z","repository":{"id":31959514,"uuid":"130664395","full_name":"wso2/ansible-apim","owner":"wso2","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-19T10:16:54.000Z","size":3763,"stargazers_count":51,"open_issues_count":16,"forks_count":61,"subscribers_count":150,"default_branch":"master","last_synced_at":"2025-03-29T16:03:44.606Z","etag":null,"topics":["api-management"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wso2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-23T08:24:52.000Z","updated_at":"2024-11-27T12:42:09.000Z","dependencies_parsed_at":"2024-11-08T14:36:26.345Z","dependency_job_id":"6724cd44-290e-4672-9b26-ed673f5c212b","html_url":"https://github.com/wso2/ansible-apim","commit_stats":{"total_commits":266,"total_committers":18,"mean_commits":"14.777777777777779","dds":0.7293233082706767,"last_synced_commit":"ef80eda22430717cab7920eab2fe4ffdddfcdf63"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fansible-apim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fansible-apim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fansible-apim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wso2%2Fansible-apim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wso2","download_url":"https://codeload.github.com/wso2/ansible-apim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369953,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-management"],"created_at":"2024-08-03T15:00:38.722Z","updated_at":"2025-04-05T17:03:49.141Z","avatar_url":"https://github.com/wso2.png","language":"Shell","funding_links":[],"categories":["Configuration management"],"sub_categories":["Microgateway"],"readme":"# WSO2 API Management Ansible scripts\n\nThis repository contains the Ansible scripts for installing and configuring WSO2 API Management.\n\n## Supported Operating Systems\n\n- Ubuntu 16.04 or higher\n- CentOS 7\n\n## Supported Ansible Versions\n\n- Ansible 2.5 or higher\n\n## Directory Structure\n```\n.\n├── dev\n│   ├── group_vars\n│   │   └── apim.yml\n│   ├── host_vars\n│   │   ├── apim-control-plane_1.yml\n│   │   ├── apim-gateway_1.yml\n│   │   ├── apim-tm_1.yml\n│   │   ├── apim_1.yml\n│   └── inventory\n├── docs\n│   ├── images\n│   │   ├── 3-fully-distributed-setup.png\n│   │   ├── API-M-single-node-deployment.png\n│   │   ├── P-H-2.png\n│   │   ├── P-H-3.png\n│   │   ├── P-M-1.png\n│   │   └── P-S-1.png\n│   ├── Pattern_1.md\n│   ├── Pattern_2.md\n│   ├── Pattern_3.md\n│   ├── Pattern_4.md\n│   └── Pattern_5.md\n├── files\n│   ├── lib\n│   │   ├── amazon-corretto-11.0.14.1-linux-x64.tar.gz\n│   └── packs\n│   │   ├── wso2am-4.1.0.zip\n│   ├── system\n│   │   └── etc\n│   │       ├── security\n│   │       │   └── limits.conf\n│   │       └── sysctl.conf\n│   └── misc\n├── issue_template.md\n├── LICENSE\n├── pull_request_template.md\n├── README.md\n├── roles\n│   ├── apim\n│   │   ├── tasks\n│   │   └── templates\n│   ├── apim-control-plane\n│   │   ├── tasks\n│   │   └── templates\n│   ├── apim-tm\n│   │   ├── tasks\n│   │   └── templates\n│   └── common\n│       └── tasks\n├── scripts\n│   ├── update.sh\n│   └── update_README.md\n└── site.yml\n\n```\n\nFollowing instructions can be followed to deploy a all-in-one standard APIM deployment to tryout the product and for demonstrations purposes. If you want to deploy a production ready deployment pattern refer the documentation in the `docs` directory.\n\n\n## Copying packs locally\nPacks could be either copied to a local directory, or downloaded from a remote location.\n\nCopy the following files to `files/packs` directory.\n\n1. [WSO2 API Manager 4.1.0 package (.zip)](https://wso2.com/api-management/install/)\n\nCopy the following files to `files/lib` directory.\n\n1. [Amazon Corretto for Linux x64 JDK 11 (.tar.gz)](https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html)\n\nCopy 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.\n\n## Downloading from remote location\n\nIn **group_vars**, change the values of the following variables in all groups:\n1. The value of `pack_location` should be changed from \"local\" to \"remote\"\n2. The value of `remote_jdk` should be changed to the URL in which the JDK should be downloaded from, and remove it as a comment.\n3. The value of `remote_pack` should be changed to the URL in which the package should be downloaded from, and remove it as a comment.\n\n## Running WSO2 API Management Ansible scripts\n\n### 1. Run the existing scripts without customization\nThe 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.\n```\n[apim]\napim_1 ansible_host=172.28.128.4 ansible_user=vagrant\n```\n\nThen, update the hostname in dev/host_vars/apim_1.yml with ansible_host, 172.28.128.4\n\nRun the following command to run the scripts. Use `-K` to provide a password to become root. Configure `become_method:` in `ansible.cfg` when using an alternative to\n`sudo`. If your host allows passwordless `sudo`, then omit the `-K` argument.\n\n`ansible-playbook -K -i dev site.yml`\n\nIf you need to alter the configurations given, please change the parameterized values in the yaml files under `group_vars` and `host_vars`.\n\n**NOTE:**\n\u003e If you have mounted the 'persistent artifacts' as guided [below](##configuration-guide), make sure to unmount the artifacts, prior to running the Ansible playbook as the playbook running process has a step to remove the existing setup. After completing the Ansible playbook running process, make sure to remount the artifacts.\n\n\u003e If the `client-truststore.jks` is monuted among the Gateway nodes, then make sure to copy the `client-truststore.jks` from the mount source to the `\u003cANSIBLE_HOME\u003e/files/security/wso2am/` directory of the Ansible resources, prior to re-running the playbook.\n\n### 2. Customize the WSO2 Ansible scripts\n\nThe templates that are used by the Ansible scripts are in j2 format in-order to enable parameterization.\n\nThe `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.\n\n#### Step 1\nUncomment the following line in `main.yml` under the role you want to customize.\n```\n- import_tasks: custom.yml\n```\n\n#### Step 2\nAdd the configurations to the `custom.yml`. A sample is given below.\n\n```\n- name: \"Copy custom file\"\n  template:\n    src: path/to/example/file/example.xml.j2\n    dest: destination/example.xml.j2\n  when: \"(inventory_hostname in groups['am'])\"\n```\n\nFollow the steps mentioned under `docs` directory to customize/create new Ansible scripts and deploy the recommended patterns.\n\n#### Including custom Keystore and Truststore\nIf custom keystores and truststores are needed to be added, uncomment the below list in the yml file\n```\n# security_file_list:\n#   - { src: '{{ security_file_location }}/wso2am-analytics/client-truststore.jks',\n#       dest: '{{ carbon_home }}/resources/security/client-truststore.jks' }\n#   - { src: '{{ security_file_location }}/wso2am-analytics/wso2carbon.jks',\n#       dest: '{{ carbon_home }}/resources/security/wso2carbon.jks' }\n```\nThen save the changed file and add the required files under `files/security/\u003cproduct-home\u003e/\u003cpath-to-file\u003e`\n\n## Performance Tuning\n\nSystem 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`.\n\nSystem 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.\n\n## Configuration Guide\n\nRefer the below documentation on configuring key-stores for APIM and APIM-Analytics\n1. [WSO2 API Manager key-stores configuration guide](https://apim.docs.wso2.com/en/latest/install-and-setup/setup/security/configuring-keystores/configuring-keystores-in-wso2-api-manager/)\n\nRefer the below documentation on configuring persistent artifacts of the servers.\n1. [Persistent artifacts of the servers](https://apim.docs.wso2.com/en/latest/install-and-setup/setup/reference/common-runtime-and-configuration-artifacts/)\n\nRefer the below documentation on configuring Load-Balancers for your deoloyment.\n1. [Load balancer configurations](https://apim.docs.wso2.com/en/latest/install-and-setup/setup/setting-up-proxy-server-and-the-load-balancer/configuring-the-proxy-server-and-the-load-balancer/)\n\n## Previous versions of Ansible\n\nThe 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.\n\n#### Ansible resources for API Manager 4.0.0\n\nBranch name: 4.0.x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwso2%2Fansible-apim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwso2%2Fansible-apim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwso2%2Fansible-apim/lists"}