Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
60 lines (58 sloc)
1.7 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"base_image": "change me with the '-var base_image=whatever' arg", | |
"new_image": "change me with the '-var new_image=whatever' arg", | |
"access_key": "change me with the '-var access_key=whatever' arg", | |
"secret_key": "change me with the '-var secret_key=whatever' arg", | |
"script": "change me with the '-var script=whatever' arg", | |
"script_args": "change me with the '-var script_args=whatever' arg" | |
}, | |
"builders": [{ | |
"type": "amazon-ebs", | |
"region": "us-west-2", | |
"vpc_id": "", | |
"subnet_id": "", | |
"instance_type": "t2.micro", | |
"access_key": "{{user `access_key`}}", | |
"secret_key": "{{user `secret_key`}}", | |
"ssh_username": "centos", | |
"ami_name": "{{user `new_image`}} {{timestamp}}", | |
"source_ami": "{{user `base_image`}}", | |
"ami_block_device_mappings": [ | |
{ | |
"device_name": "/dev/sda1", | |
"volume_size": 30 | |
} | |
], | |
"ssh_pty" : "true", | |
"tags": { | |
"project": "demo" | |
}, | |
"run_tags":{ | |
"project": "demo" | |
} | |
}], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E '{{ .Path }}' {{user `script_args`}}", | |
"scripts": "{{user `script`}}" | |
}, | |
{ | |
"type": "shell", | |
"inline": [ | |
"echo 'Rebooting for bootstrap changes to take effect.';sudo systemctl reboot" | |
] | |
}, | |
{ | |
"type": "shell", | |
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E '{{ .Path }}'", | |
"scripts": "install_service_rpm.sh" | |
}, | |
{ | |
"type": "shell", | |
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E '{{ .Path }}'", | |
"scripts": "build_service_container.sh" | |
} | |
] | |
} |