Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 097ee95

Browse files
committed
Make install conditional
1 parent 9ca5e36 commit 097ee95

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

examples/vault-consul-ami/vault-consul.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"consul_version": "1.3.1",
88
"consul_download_url": "{{env `CONSUL_DOWNLOAD_URL`}}",
99
"vault_download_url": "{{env `VAULT_DOWNLOAD_URL`}}",
10+
"install_auth_signing_script": "true",
1011
"ca_public_key_path": null,
1112
"tls_public_key_path": null,
1213
"tls_private_key_path": null
@@ -86,7 +87,11 @@
8687
},{
8788
"type": "shell",
8889
"inline": [
90+
"if [ '{{user `install_auth_signing_script`}}' = 'true' ]; then",
8991
"sudo mv /tmp/sign-request.py /opt/vault/scripts/",
92+
"else",
93+
"sudo rm /tmp/sign-request.py",
94+
"fi",
9095
"sudo mv /tmp/ca.crt.pem /opt/vault/tls/",
9196
"sudo mv /tmp/vault.crt.pem /opt/vault/tls/",
9297
"sudo mv /tmp/vault.key.pem /opt/vault/tls/",
@@ -98,8 +103,11 @@
98103
},{
99104
"type": "shell",
100105
"inline": [
101-
"sudo apt-get install -y git python-pip",
102-
"LC_ALL=C && sudo pip install boto3"
106+
"sudo apt-get install -y git",
107+
"if [ '{{user `install_auth_signing_script`}}' = 'true' ]; then",
108+
"sudo apt-get install -y python-pip",
109+
"LC_ALL=C && sudo pip install boto3",
110+
"fi"
103111
],
104112
"only": ["ubuntu16-ami"]
105113
},{

examples/vault-iam-auth/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ of the Vault nodes.
3636

3737
1. `git clone` this repo to your computer.
3838
1. Build a Vault and Consul AMI. See the [vault-consul-ami example][vault_consul_ami] documentation for
39-
instructions. Make sure to note down the ID of the AMI.
39+
instructions. Make sure the `install_auth_signing_script` variable is `true`.
40+
Make sure to note down the ID of the AMI.
4041
1. Install [Terraform](https://www.terraform.io/).
4142
1. Open `vars.tf`, set the environment variables specified at the top of the file, and fill in any other variables that
4243
don't have a default. Put the AMI ID you previously took note into the `ami_id` variable.

0 commit comments

Comments
 (0)