You can get continuous updates for your Dev, Staging, and Production Environments using the Configuration Management tools as its benefits are highlighted. Namely, changes and deployments are implemented faster, remove the possible room for human error, while making system management predictable and scalable. Below are the steps a user has to follow to seamlessly propagate updates to multiple environments. (To easily illustrate we are describing this process for a user using the latest version of WSO2 APIM and managing continuous updates using Ansible)
Configuring the control node for propagation¶
Install the Ansible v.2.5 in your deployment environment. Refer Ansible Installation Guide
Thereafter, take a git clone [WSO2 APIM Ansible resources] (https://github.com/wso2/ansible-apim/)
git clone https://github.com/wso2/ansible-apim.git
Check out the latest tag of the product version.
cd ansible-apim git checkout <version of the latest tag>
The above command will be like
git checkout v22.214.171.124 for the latest WSO2 APIM 3.2.0 version.
The Ansible resources obtained from GitHub only contains resources for a single deployment environment (dev) by default. The parameters with respect to this environment are found in the
Shown below is the folder structure of the
|-- apim-ansible(git) | |- dev | | |- host_vars<profiles> | | |- group_vars<profiles> | | |- Inventory
4. Create copies of the same directory and rename them reflecting the required deployment environments in your setup (e.g., Staging, Production).
cp -r dev staging cp -r dev production
5. Next, configure the parameters in the
host_vars directories to values suitable to the deployment environment.
6. Later navigate to the
Inventory folder and change the [ip_address] and [ssh_user] details for the preferred environment.
7. Last refer copy files locally and perform the required changes.
Propagating updates to Multiple Environments¶
After all the above steps are completed, navigate to the
scriptfolder in the control node and run update.sh file. Define the product pack that must be updated with respect to the profile to be updated.
cd ansible-apim/scripts ./update.sh -p apim
For more information on executing the update script, please refer to the documentation in
- When the above-mentioned update.sh file is executed, the script brings up the relevant product pack to its latest update level.
- While the product pack is brought up-to-date, conflicts could be encountered if the user has made customizations to the pack and will be displayed in the console.
Therefore, conflicting changes should be resolved by perusing the resolve conflicts page and thereafter re-running the update.sh file.
./update.sh -p <profile-name>]
./update.sh -p apim
After all the conflicts are resolved (Without producing warning or errors) in your current environment, updates are properly installed in the aforementioned environment.
Perform git commit and push the template changes to your repository everytime a successful update has been performed.
Disseminate the update to the other deployment environments (dev) using the following command. Now the user can perform their expected test on this environment as the updates are properly propagated to the development environment.
ansible-playbook -i dev site.yml
9. Thereafter distribution of updates to Staging and Production environments can be done using these commands:
ansible-playbook -i staging site.yml ansible-playbook -i production site.yml
10. Updated product pack changes will be distributed to the respective deployment environment.