From 2299596613b62fd2fc469128775e3face656a2b9 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Mon, 16 Sep 2019 11:53:37 +1000 Subject: [PATCH 1/6] DCD-658: Add injection of custom parameters to the ansible commandline. --- bin/ansible-with-atl-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ansible-with-atl-env b/bin/ansible-with-atl-env index 14a9938..393cb02 100755 --- a/bin/ansible-with-atl-env +++ b/bin/ansible-with-atl-env @@ -15,4 +15,4 @@ set +a # Use Ansible from virtualenv if provided pipenv run \ - ansible-playbook -v -i $INV $PLAYBOOK 2>&1 | tee --append $LOG_FILE + ansible-playbook -v -i $INV $ATL_DEPLOYMENT_REPOSITORY_CUSTOM_PARAMS $PLAYBOOK 2>&1 | tee --append $LOG_FILE From c687f8ab7663a049b4c71c42b8e02b2f6843157b Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Mon, 16 Sep 2019 11:56:22 +1000 Subject: [PATCH 2/6] DCD-658: Break up commandline for clarity. --- bin/ansible-with-atl-env | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/ansible-with-atl-env b/bin/ansible-with-atl-env index 393cb02..599a2f9 100755 --- a/bin/ansible-with-atl-env +++ b/bin/ansible-with-atl-env @@ -15,4 +15,8 @@ set +a # Use Ansible from virtualenv if provided pipenv run \ - ansible-playbook -v -i $INV $ATL_DEPLOYMENT_REPOSITORY_CUSTOM_PARAMS $PLAYBOOK 2>&1 | tee --append $LOG_FILE + ansible-playbook \ + -v $ATL_DEPLOYMENT_REPOSITORY_CUSTOM_PARAMS \ + -i $INV \ + $PLAYBOOK \ + 2>&1 | tee --append $LOG_FILE From 84e37e7df9a0e03a00e52618944882e514673586 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Tue, 17 Sep 2019 08:48:30 +1000 Subject: [PATCH 3/6] DCD-658: Rename extra parameter variable for clarity. --- bin/ansible-with-atl-env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ansible-with-atl-env b/bin/ansible-with-atl-env index 599a2f9..55b6e8e 100755 --- a/bin/ansible-with-atl-env +++ b/bin/ansible-with-atl-env @@ -15,8 +15,8 @@ set +a # Use Ansible from virtualenv if provided pipenv run \ - ansible-playbook \ - -v $ATL_DEPLOYMENT_REPOSITORY_CUSTOM_PARAMS \ + ansible-playbook -v \ + $ATL_ANSIBLE_EXTRA_PARAMS \ -i $INV \ $PLAYBOOK \ 2>&1 | tee --append $LOG_FILE From ddd792ecfe3a153a2fc70ea1e8237f8e1a74d101 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Tue, 17 Sep 2019 14:31:39 +1000 Subject: [PATCH 4/6] DCD-658: Update README with notes about adding custom command-line parameters. --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51dc0f9..4415ff3 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,31 @@ sourced as environment variables to be retrieved at runtime . See the helper-script `bin/ansible-with-atl-env` and the corresponding `groups_vars/aws_node_local.yml` var-file. -### Maintenance playbooks +#### Overriding parameters -(None currently; TBW) +If you want to customise the playbook behaviour the simplest method is to fork +this repository and add your own. However for some one-off tasks may be OK to +override the default and calculated settings with special values. This can be +done by providing command-line overrides to +[ansible-playbook](https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html). + +The most likely use-case for this is to download a custom product distribution +for testing, e.g. a Jira pre-release. If you are running `ansible-playbook` +directly, the command-line would look like e.g: + + ansible-playbook \ + -e atl_product_download_url=http://s3.amazon.com/atlassian/jira-9.0.0-PRE-TEST.tar.gz \ + -e atl_use_system_jdk=true \ + -e atl_download_format=tarball \ + \ + -i inv/aws_node_local aws_jira_dc_node.yml + +If you are using a CloudFormation template with places the stack details in +`/etc/atl`, the special variable `ATL_ANSIBLE_EXTRA_PARAMS` is added to the +`ansible-playbook` parameters in `bin/ansible-with-alt-env`. In this case you +would only need to set it to: + + -e atl_product_download_url=http://s3.amazon.com/atlassian/jira-9.0.0-PRE-TEST.tar.gz -e atl_use_system_jdk=true -e atl_download_format=tarball ## Development From cc3cdb3b984423e4268f0dc5bb031759475ec627 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Tue, 17 Sep 2019 14:33:27 +1000 Subject: [PATCH 5/6] DCD-658: Full env var setting. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4415ff3..864da44 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ If you are using a CloudFormation template with places the stack details in `ansible-playbook` parameters in `bin/ansible-with-alt-env`. In this case you would only need to set it to: - -e atl_product_download_url=http://s3.amazon.com/atlassian/jira-9.0.0-PRE-TEST.tar.gz -e atl_use_system_jdk=true -e atl_download_format=tarball + ATL_ANSIBLE_EXTRA_PARAMS="-e atl_product_download_url=http://s3.amazon.com/atlassian/jira-9.0.0-PRE-TEST.tar.gz -e atl_use_system_jdk=true -e atl_download_format=tarball" ## Development From b7c3af2461427aa945ac0cdb220d7c89ebf0138f Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Tue, 17 Sep 2019 15:44:02 +1000 Subject: [PATCH 6/6] DCD-658: README updates from review. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 864da44..bfdf3dd 100644 --- a/README.md +++ b/README.md @@ -30,14 +30,14 @@ helper-script `bin/ansible-with-atl-env` and the corresponding #### Overriding parameters If you want to customise the playbook behaviour the simplest method is to fork -this repository and add your own. However for some one-off tasks may be OK to -override the default and calculated settings with special values. This can be -done by providing command-line overrides to +this repository and add your own. However, for some one-off tasks you can also +override the default and calculated settings with special values. To do this, +provide command-line overrides to [ansible-playbook](https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html). The most likely use-case for this is to download a custom product distribution -for testing, e.g. a Jira pre-release. If you are running `ansible-playbook` -directly, the command-line would look like e.g: +for testing (for example, a pre-release version of Jira). If you are running +ansible-playbook directly, the command for this would look like the following: ansible-playbook \ -e atl_product_download_url=http://s3.amazon.com/atlassian/jira-9.0.0-PRE-TEST.tar.gz \ @@ -46,10 +46,10 @@ directly, the command-line would look like e.g: \ -i inv/aws_node_local aws_jira_dc_node.yml -If you are using a CloudFormation template with places the stack details in -`/etc/atl`, the special variable `ATL_ANSIBLE_EXTRA_PARAMS` is added to the -`ansible-playbook` parameters in `bin/ansible-with-alt-env`. In this case you -would only need to set it to: +You can also do this on a CloudFormation template where the stack details are in +/etc/atl. On such templates, the variable `ATL_ANSIBLE_EXTRA_PARAMS` is added +to the `ansible-playbook` parameters in `bin/ansible-with-alt-env`. In this case +you need to set it to: ATL_ANSIBLE_EXTRA_PARAMS="-e atl_product_download_url=http://s3.amazon.com/atlassian/jira-9.0.0-PRE-TEST.tar.gz -e atl_use_system_jdk=true -e atl_download_format=tarball"