Skip to content

Latest commit

 

History

History
139 lines (101 loc) · 3.73 KB

File metadata and controls

139 lines (101 loc) · 3.73 KB

New-Autoinstall

SYNOPSIS

Creates a cloud-init config files from a user JSON file for an Ubuntu automated installation.

SYNTAX

New-Autoinstall [-DeployVariablesFile] <FileInfo> [[-OutPath] <String>] [-StartLog] [[-LogFile] <String>]
 [<CommonParameters>]

DESCRIPTION

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.

EXAMPLES

EXAMPLE 1

New-Autoinstall -File "deploy-variables.json" -OutPath "http"

EXAMPLE 2

New-Autoinstall -File "deploy-variables.json" -StartLog

EXAMPLE 3

New-Autoinstall -File "deploy-variables.json" -StartLog -LogFile "mylog.log"

PARAMETERS

-DeployVariablesFile

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: False

-OutPath

Path 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: False

-StartLog

Switch. 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: False

-LogFile

Path 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: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None. You cannot pipe objects to New-Autoinstall.

OUTPUTS

user-data autoinstall config file

meta-data (empty) file

NOTES

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.

RELATED LINKS

https://github.com/simplenotsimpler/New-Autoinstall

https://ubuntu.com/server/docs/install/autoinstall

https://github.com/simplenotsimpler/New-PackerVbFile

https://github.com/simplenotsimpler/Invoke-PackerBuildVbVm

https://github.com/simplenotsimpler/Deploy-VbVm