Creates a cloud-init config files from a user JSON file for an Ubuntu automated installation.
New-Autoinstall [-DeployVariablesFile] <FileInfo> [[-OutPath] <String>] [-StartLog] [[-LogFile] <String>]
[<CommonParameters>]
Creates a cloud-init config files from a user JSON file for an Ubuntu automated installation. The resulting autoinstall config file is an opinionated configuration for a Django/Nginx server set up on a local VirtualBox machine with a host-only adapter and static IP. The resulting autoinstall config file requires an empty meta-data file which is created during this process.
Feel free to fork and modify the autoinstall heredoc to suit your needs. See NOTES below for further considerations.
New-Autoinstall -File "deploy-variables.json" -OutPath "http"
New-Autoinstall -File "deploy-variables.json" -StartLog
New-Autoinstall -File "deploy-variables.json" -StartLog -LogFile "mylog.log"
JSON file which houses variables for deployment. See .\sample-deploy-variables.json for JSON schema info.
Type: FileInfo
Parameter Sets: (All)
Aliases: File
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePath where you want the generated files stored.
If not specified, creates a http folder in folder where script called from.
Note: Packer default is to use a http folder.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSwitch. Use this if you want an independent log when this script runs.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalsePath to log file. If not specified, defaults to "logs$ModuleName-$LogDate.log".
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
If editing the autoinstall heredoc, be aware of spaces to remain YAML compliant.
After changing the autoinstall heredoc, always validate the generated autoinstall file using a YAML linter.
If using VS Code, you'll want to disable your spaces auto-detection and set PowerShell to use 2 spaces instead of 4 spaces.
Markdown help page generated by platyPS.
https://github.com/simplenotsimpler/New-Autoinstall
https://ubuntu.com/server/docs/install/autoinstall
https://github.com/simplenotsimpler/New-PackerVbFile