Skip to content

Latest commit

 

History

History
713 lines (563 loc) · 12.2 KB

New-AnsibleJobTemplate.md

File metadata and controls

713 lines (563 loc) · 12.2 KB
external help file Module Name online version schema
Jagabata.psm.dll-Help.xml
Jagabata.psm
2.0.0

New-AnsibleJobTemplate

SYNOPSIS

Create a JobTemplate.

SYNTAX

New-AnsibleJobTemplate -Name <String> [-Description <String>] [-JobType <JobType>] [-Inventory <UInt64>]
 [-Project <UInt64>] -Playbook <String> [-ScmBranch <String>] [-Forks <Int32>] [-Limit <String>]
 [-Verbosity <JobVerbosity>] [-ExtraVars <String>] [-Tags <String>] [-ForceHandlers] [-SkipTags <String>]
 [-StartAtTask <String>] [-Timeout <Int32>] [-UseFactCache] [-ExecutionEnvironment <UInt64>]
 [-HostConfigKey <String>] [-AskScmBranch] [-AskDiffMode] [-AskVariables] [-AskLimit] [-AskTags] [-AskSkipTags]
 [-AskJobType] [-AskVerbosity] [-AskInventory] [-AskCredential] [-AskExecutionEnvironment] [-AskLabels]
 [-AskForks] [-AskJobSliceCount] [-SurveyEnabled] [-BecomeEnabled] [-DiffMode] [-AllowSimultaneous]
 [-JobSliceCount <Int32>] [-WebhookService <String>] [-WebhookCredential <UInt64>]
 [-PreventInstanceGroupFallback] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Create a JobTemplate.

Implementation of following API:

  • /api/v2/job_templates/ (POST)

EXAMPLES

Example 1

PS C:\> $inventory = Get-AnsibleInventory -Id 2
PS C:\> $project = Get-AnsibleProject -Id 3
PS C:\> New-AnsibleJobTemplate -Name jobTemplateName1 -Inventory $inventory -Project $project -Playbook path/to/playbok1.yml

PARAMETERS

-AllowSimultaneous

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskCredential

Ask credential on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskDiffMode

Ask diff-mode on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskExecutionEnvironment

Ask execution environment on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskForks

Ask number of forks on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskInventory

Ask inventory on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskJobSliceCount

Ask job slice count on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskJobType

Ask job-type on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskLabels

Ask labels on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskLimit

Ask limit on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskScmBranch

Ask scm-branch on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskSkipTags

Ask skip tags on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskTags

Ask job tags on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskVariables

Ask extra variables on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AskVerbosity

Ask verbosity on launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-BecomeEnabled

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Description

Optional description of the JobTemplate.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DiffMode

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExecutionEnvironment

ExecutionEnvironment ID.

Type: UInt64
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExtraVars

Specify extra variables.

Specify in JSON or YAML format. You can also specify an object of type IDictionary as a parameter value.

Example: -ExtraVars @{ key1 = "string"; key2 = 10; key3 = Get-Date }

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ForceHandlers

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Forks

Number of forks.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-HostConfigKey

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Inventory

Inventory ID.

Type: UInt64
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-JobSliceCount

Number of job slice count.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-JobType

Specify JobType ("Run" or "Check")

Type: JobType
Parameter Sets: (All)
Aliases:
Accepted values: Run, Check

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Limit

Further limit selected hosts to an additional pattern.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Name

Name of the JobTemplate.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Playbook

File path of the playbook in the specified Project.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PreventInstanceGroupFallback

If enabled, the job template will prevent adding any inventory or organization instance groups to the list of preferred instances groups to run on. If this setting is enabled and you provided an empty list, the global instance groups will be applied.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Project

Project ID.

Type: UInt64
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ScmBranch

Specify branch to use in job run. Project default is used if omitted.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SkipTags

Skip tags. (commas , separated)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-StartAtTask

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SurveyEnabled

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Tags

Job tags. (commas , separated)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Timeout

Timeout value (seconds).

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-UseFactCache

If enabled, the service will act as an Ansible Fact Cache Plugin; persisting facts at the end of a playbook run to the database and caching facts for use by Ansible.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Verbosity

Job verbosity.

Type: JobVerbosity
Parameter Sets: (All)
Aliases:
Accepted values: Normal, Verbose, MoreVerbose, Debug, ConnectionDebug, WinRMDebug

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WebhookCredential

Credential ID of Personal Access Token (github or gitlab) for posting back the status to the service api.

Type: UInt64
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WebhookService

Service that webhook requests will be accepted from github or gitlab

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: github, gitlab, 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

None

OUTPUTS

Jagabata.Resources.JobTemplate

New created JobTemplate object.

NOTES

RELATED LINKS

Get-AnsibleJobTemplate

Find-AnsibleJobTemplate

Update-AnsibleJobtemplate

Remove-AnsibleJobTemplate