[Feature Idea] Remote Install Script for Effortless
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 35
- Forks
- 35
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 8
Description
Problem Statement
Currently, there are multiple lines of code required to be manipulated in an inline powershell or bash script for a Packer template in order to get an image built with Packer. This is also true with any other tool used to build an image (such as AWS user_data. This causes many points at which there could be a possible mis-configuration, missed step, etc...
For example, if I were to install Effortless Audit and Config using a Packer template, I would need to write something like this for a Windows 2016 Server:
"provisioners": [
{
"type": "powershell",
"inline": [
"iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))",
"C:/ProgramData/chocolatey/choco install habitat -y",
"New-NetFirewallRule -DisplayName \"Habitat TCP\" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 9631,9638",
"New-NetFirewallRule -DisplayName \"Habitat UDP\" -Direction Inbound -Action Allow -Protocol UDP -LocalPort 9638",
"C:\\ProgramData\\chocolatey\\bin\\hab license accept",
"C:\\ProgramData\\chocolatey\\bin\\hab pkg install core/windows-service",
"C:\\ProgramData\\chocolatey\\bin\\hab pkg exec core/windows-service install",
"C:\\ProgramData\\chocolatey\\bin\\hab pkg install core/hab-sup",
"C:\\ProgramData\\chocolatey\\bin\\hab pkg install -z \"{{ user `hab_auth_token` }}\" dbright/config-baseline",
"C:\\ProgramData\\chocolatey\\bin\\hab pkg install -z \"{{ user `hab_auth_token` }}\" dbright/audit-01-win",
"$env:PATH = \"$(C:\\ProgramData\\chocolatey\\bin\\hab pkg path stuartpreston/chef-client-detox)/bin\"",
"$env:PATH = \"$(C:\\ProgramData\\chocolatey\\bin\\hab pkg path stuartpreston/inspec)/bin;$env:PATH\"",
"cd $(C:\\ProgramData\\chocolatey\\bin\\hab pkg path dbright/config-baseline)",
"Write-Host 'Starting Chef Infra Client Run'",
"chef-client -z -c config/bootstrap-config.rb",
"Write-Host 'Starting InSpec Run'",
"inspec exec \"$(C:\\ProgramData\\chocolatey\\bin\\hab pkg path dbright/audit-01-win)/dist.tar.gz\" --json-config \"$(C:\\ProgramData\\chocolatey\\bin\\hab pkg path dbright/audit-01-win)/config/bootstrap-inspec.json\" --no-distinct-exit",
"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule",
"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1 -NoShutdown"
]
}
That is a TON of things to keep updated, and a lot of error prone steps, multiply this over many Packer builds (not just Packer, anything installing Effortless in an automated manner), and you have many more opportunities for human error.
Possible Solution
Other tools, such as Chocolately get around this by having a remote install script that can be called with a single line. If we had a similar way of calling our Hab installer and required Effortless packages by calling a remote install script, and setting some Packer variables that would be read in, then we can control the install process and make it more seamless.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files, tests, or entry points are named. Start by reviewing the issue's Packer and AWS user_data examples and determine how a remote installer would receive Packer variables and required Effortless packages. Done should mean a single remote install call can replace the repeated installation and configuration steps across automated image builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, bash, powershell
- Domain
- cloud, devops, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100