|
1 | 1 | { |
2 | 2 | "AWSTemplateFormatVersion": "2010-09-09", |
3 | | - "Description": "QS(0037) HashiCorp Consul License: Apache 2.0 (Please do not remove) Oct,31,2016", |
| 3 | + "Description": "QS(0037) HashiCorp Consul License: Apache 2.0 (Please do not remove) Nov,3,2016", |
4 | 4 | "Parameters": { |
5 | 5 | "KeyPair": { |
6 | 6 | "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", |
|
349 | 349 | "owner": "root", |
350 | 350 | "group": "root" |
351 | 351 | }, |
352 | | - "/etc/init/vault-upstart.conf": { |
| 352 | + "/etc/init/vault.conf": { |
353 | 353 | "source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault-upstart.conf", |
354 | 354 | "mode": "000700", |
355 | 355 | "owner": "root", |
356 | | - "group": "root" |
| 356 | + "group": "root", |
| 357 | + "command": "echo 'export VAULT_ADDR=http://127.0.0.1:8200' > /etc/profile.d/vault.sh" |
357 | 358 | } |
358 | 359 | }, |
359 | 360 | "commands": { |
|
365 | 366 | "run_vault": { |
366 | 367 | "commands": { |
367 | 368 | "01_register_vault_binary": { |
368 | | - "command": "chmod 755 vault", |
369 | | - "command": "update-rc.d vault defaults", |
370 | | - "command": "update-rc.d vault enable", |
371 | | - "cwd": "/etc/init.d/" |
| 369 | + "command": "start vault", |
372 | 370 | } |
373 | 371 | } |
374 | 372 | } |
|
411 | 409 | "Fn::Join": [ |
412 | 410 | "", [ |
413 | 411 | "#!/bin/bash -x\n", |
414 | | - "mkdir -p /opt/vault/policies/ /opt/vault/scripts/ /etc/vault.d/\n", |
415 | 412 | "apt-get -y update\n", |
416 | | - "#install the cfn-init tools\n", |
417 | | - "apt-get -y install python-pip\n", |
418 | | - "pip install pyOpenSSL ndg-httpsclient pyasn1\n", |
| 413 | + "apt-get -y install python-setuptools\n", |
419 | 414 | "easy_install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz\n", |
| 415 | + "mkdir -p /opt/vault/policies/ /opt/vault/scripts/ /etc/vault.d/\n", |
| 416 | + "SEEDIP=\"", |
| 417 | + { |
| 418 | + "Ref": "ConsulSeedPrivateIP" |
| 419 | + },"\"\n", |
| 420 | + "wget https://s3.amazonaws.com/quickstart-reference/hashicorp/consul/latest/scripts/consul_client_bootstrap.sh\n", |
| 421 | + "chmod 755 ./consul_client_bootstrap.sh\n", |
| 422 | + "./consul_client_bootstrap.sh --s3url https://s3.amazonaws.com --s3bucket quickstart-reference --s3prefix hashicorp/consul/latest --seedip ${SEEDIP}", |
| 423 | + "\n", |
420 | 424 | "/usr/local/bin/cfn-init", |
421 | 425 | " --verbose ", |
422 | 426 | " --stack ", { |
|
427 | 431 | " --region ", { |
428 | 432 | "Ref": "AWS::Region" |
429 | 433 | }, "\n", |
430 | | - "CONSULSEED=\"", |
431 | | - { |
432 | | - "Ref": "ConsulSeedPrivateIP" |
433 | | - },"\"\n", |
434 | | - "sed -i -e s/__CONSULSEED__/${CONSULSEED}/ /etc/vault.d/vault.hcl", |
435 | | - "\n", |
436 | | - "echo \"Starting Vault Server \" \n", |
437 | | - "vault server -config /etc/vault.d/vault.hcl", |
438 | | - "\n", |
439 | 434 | "/usr/local/bin/cfn-signal -e $? ", |
440 | 435 | " --stack ", { |
441 | 436 | "Ref": "AWS::StackName" |
|
531 | 526 | "commands": { |
532 | 527 | "01_run_awslogs_agent_setup.py": { |
533 | 528 | "command": { |
534 | | - "Fn::Sub": ["python /usr/local/awslogs-agent-setup.py -n -r ${Region} -c https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault/awslogs-config-file", { |
| 529 | + "Fn::Sub": ["python /usr/local/awslogs-agent-setup.py -n -r ${Region} -c https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/awslogs-config-file", { |
535 | 530 | "Region": { |
536 | 531 | "Ref": "AWS::Region" |
537 | 532 | } |
|
549 | 544 | }, |
550 | 545 | "files": { |
551 | 546 | "/etc/vault.d/vault.hcl": { |
552 | | - "source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault/vault.hcl", |
| 547 | + "source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault.hcl", |
553 | 548 | "mode": "000700", |
554 | 549 | "owner": "root", |
555 | 550 | "group": "root" |
556 | 551 | }, |
557 | | - "/etc/init/vault-upstart.conf": { |
558 | | - "source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault/vault-upstart.conf", |
| 552 | + "/etc/init/vault.conf": { |
| 553 | + "source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault-upstart.conf", |
559 | 554 | "mode": "000700", |
560 | 555 | "owner": "root", |
561 | | - "group": "root" |
| 556 | + "group": "root", |
| 557 | + "command": "echo 'export VAULT_ADDR=http://127.0.0.1:8200' > /etc/profile.d/vault.sh" |
562 | 558 | } |
563 | 559 | }, |
564 | 560 | "commands": { |
|
570 | 566 | "run_vault": { |
571 | 567 | "commands": { |
572 | 568 | "01_register_vault_binary": { |
573 | | - "command": "chmod 755 vault", |
574 | | - "command": "update-rc.d vault defaults", |
575 | | - "command": "update-rc.d vault enable", |
576 | | - "cwd": "/etc/init.d/" } |
| 569 | + "command": "start vault", |
| 570 | + } |
577 | 571 | } |
578 | 572 | } |
579 | 573 | } |
|
618 | 612 | "mkdir -p /opt/vault/policies/ /opt/vault/scripts/ /etc/vault.d/\n", |
619 | 613 | "apt-get -y update\n", |
620 | 614 | "#install the cfn-init tools\n", |
621 | | - "apt-get -y install python-pip\n", |
622 | | - "pip install pyOpenSSL ndg-httpsclient pyasn1\n", |
| 615 | + "apt-get install python-setuptools\n", |
623 | 616 | "easy_install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz\n", |
| 617 | + "SEEDIP=\"", |
| 618 | + { |
| 619 | + "Ref": "ConsulSeedPrivateIP" |
| 620 | + },"\"\n", |
| 621 | + "wget https://s3.amazonaws.com/quickstart-reference/hashicorp/consul/latest/scripts/consul_client_bootstrap.sh\n", |
| 622 | + "chmod 755 ./consul_client_bootstrap.sh\n", |
| 623 | + "./consul_client_bootstrap.sh --s3url https://s3.amazonaws.com --s3bucket quickstart-reference --s3prefix hashicorp/consul/latest --seedip ${SEEDIP}", |
| 624 | + "\n", |
624 | 625 | "/usr/local/bin/cfn-init", |
625 | 626 | " --verbose ", |
626 | 627 | " --stack ", { |
|
631 | 632 | " --region ", { |
632 | 633 | "Ref": "AWS::Region" |
633 | 634 | }, "\n", |
634 | | - "CONSULSEED\"=", |
635 | | - { |
636 | | - "Ref": "ConsulSeedPrivateIP" |
637 | | - },"\"\n", |
638 | | - "sed -i -e s/__CONSULSEED__/${CONSULSEED}/ /etc/vault.d/vault.hcl", |
639 | | - "\n", |
640 | | - "echo \"Starting Vault Server \" \n", |
641 | | - "vault server -config /etc/vault.d/vault.hcl", |
642 | | - "\n", |
643 | 635 | "/usr/local/bin/cfn-signal -e $? ", |
644 | 636 | " --stack ", { |
645 | 637 | "Ref": "AWS::StackName" |
|
0 commit comments