Ansible Usage
Here are some Ansible-related tips that will help you get the most from the Self-Managed Commerce build tools.
Defining Ansible Variables
You can modify the behaviour of the Ansible roles and playbooks by defining and overriding variables.
Defining variables at runtime
Defining variables at runtime is the recommended method to override existing variables. To modify variable values when running a playbook, use the -e <variable>='<value>'
syntax with ansible-playbook
. You can specify -e
multiple times to define multiple variables.
Example:
ansible-playbook -e use_img='false' -e image_tag='dev' configure_build_image.yml
note
Variables defined at runtime will always override the default values defined in code.
Defining variables in code
You can define new default values for your environment in the code. These values are applied whenever the playbook is invoked.
- Clone the Self-Managed Commerce source code project
ep-commerce
from your organization Git repository. - Checkout the
ep-commerce
branch that you will be building. - Open the Ansible file in question. The files are located under
devops/build_tools
anddevops/build_tools_extras
. - Modify the variable values that you would like to change.
- Commit the changes and push them to your organization Git repository.