Skip to content

cdk-ans

This package contains the core code to define Ansible playbooks as CDK.

It is part of the larger repo cdk-ans where documentation can be found.

API Reference

Constructs

App

Represents a cdk-ans application.

Initializers

import { App } from 'cdk-ans'

new App(props?: AppProps)
Name Type Description
props AppProps configuration options.

propsOptional

configuration options.


Methods

Name Description
toString Returns a string representation of this construct.
synth Synthesizes all resources to the output directory.

toString
public toString(): string

Returns a string representation of this construct.

synth
public synth(): void

Synthesizes all resources to the output directory.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { App } from 'cdk-ans'

App.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
inventories Inventory[] Returns all the inventories in this app, sorted topologically.
outdir string The output directory into which files will be synthesized.
playbooks Playbook[] Returns all the playbooks in this app, sorted topologically.
projects Project[] Returns all the playbooks in this app, sorted topologically.
roles Role[] Returns all the roles in this app, sorted topologically.
synthesizer ISynthesizer The synthesizer that will be used to synthesize the project.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


inventoriesRequired
public readonly inventories: Inventory[];

Returns all the inventories in this app, sorted topologically.


outdirRequired
public readonly outdir: string;
  • Type: string

The output directory into which files will be synthesized.


playbooksRequired
public readonly playbooks: Playbook[];

Returns all the playbooks in this app, sorted topologically.


projectsRequired
public readonly projects: Project[];

Returns all the playbooks in this app, sorted topologically.


rolesRequired
public readonly roles: Role[];

Returns all the roles in this app, sorted topologically.


synthesizerRequired
public readonly synthesizer: ISynthesizer;

The synthesizer that will be used to synthesize the project.


Block

Initializers

import { Block } from 'cdk-ans'

new Block(scope: Construct, name: string, props: BlockProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props BlockProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.
next No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any
next
public next(next: ITaskChainable): TaskDefinition
nextRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Block } from 'cdk-ans'

Block.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
chain Step[] No description.
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
tasks TaskDefinition No description.
always TaskDefinition No description.
notify Handler[] No description.
rescue TaskDefinition No description.
when Conditional No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


chainRequired
public readonly chain: Step[];

nameRequired
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

tasksRequired
public readonly tasks: TaskDefinition;

alwaysOptional
public readonly always: TaskDefinition;

notifyOptional
public readonly notify: Handler[];

rescueOptional
public readonly rescue: TaskDefinition;

whenOptional
public readonly when: Conditional;

File

Initializers

import { File } from 'cdk-ans'

new File(scope: Construct, name: string, props: FileProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props FileProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { File } from 'cdk-ans'

File.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
fileName string No description.
path string No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


fileNameRequired
public readonly fileName: string;
  • Type: string

pathRequired
public readonly path: string;
  • Type: string

Handler

Initializers

import { Handler } from 'cdk-ans'

new Handler(scope: Construct, name: string, props: HandlerProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props HandlerProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Handler } from 'cdk-ans'

Handler.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
chain Step[] No description.
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
action TaskAction No description.
listen string No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


chainRequired
public readonly chain: Step[];

nameRequired
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

actionRequired
public readonly action: TaskAction;

listenOptional
public readonly listen: string;
  • Type: string

Host

Represents a host in an Ansible inventory.

https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html#inventory-basics-formats-hosts-and-groups

Initializers

import { Host } from 'cdk-ans'

new Host(scope: Construct, name: string, props: HostProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props HostProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
addVariables Assigns additional variables to this host.
toJson No description.

toString
public toString(): string

Returns a string representation of this construct.

addVariables
public addVariables(variables: HostVariable): void

Assigns additional variables to this host.

variablesRequired

A list of variables to add to this host.


toJson
public toJson(): {[ key: string ]: any}

Static Functions

Name Description
isConstruct Checks if x is a construct.
isHost Return whether the given object is a Host.

isConstruct
import { Host } from 'cdk-ans'

Host.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isHost
import { Host } from 'cdk-ans'

Host.isHost(x: any)

Return whether the given object is a Host.

xRequired
  • Type: any

Properties

Name Type Description
node constructs.Node The tree node.
ansibleConnection AnsibleConnection No description.
ansibleHost string No description.
identifier string No description.
variables HostVariable[] No description.
ansibleBecome boolean No description.
ansiblePassword string No description.
ansiblePort number No description.
ansibleUser string No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


ansibleConnectionRequired
public readonly ansibleConnection: AnsibleConnection;

ansibleHostRequired
public readonly ansibleHost: string;
  • Type: string

identifierRequired
public readonly identifier: string;
  • Type: string

variablesRequired
public readonly variables: HostVariable[];

ansibleBecomeOptional
public readonly ansibleBecome: boolean;
  • Type: boolean

ansiblePasswordOptional
public readonly ansiblePassword: string;
  • Type: string

ansiblePortOptional
public readonly ansiblePort: number;
  • Type: number

ansibleUserOptional
public readonly ansibleUser: string;
  • Type: string

HostGroup

A group of hosts in an Ansible inventory.

https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#inventory-basics-formats-hosts-and-groups

Initializers

import { HostGroup } from 'cdk-ans'

new HostGroup(scope: Construct, name: string, props?: HostGroupProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props HostGroupProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsOptional

Methods

Name Description
toString Returns a string representation of this construct.
addHosts Assigns additional hosts to this group.
addSubGroups Assigns additional groups as subgroups to this group.
addVariables Assigns additional variables to this group.
toJson JSONify this group.

toString
public toString(): string

Returns a string representation of this construct.

addHosts
public addHosts(hosts: Host): void

Assigns additional hosts to this group.

hostsRequired

A list of hosts to add to this group.


addSubGroups
public addSubGroups(groups: HostGroup): void

Assigns additional groups as subgroups to this group.

groupsRequired

A list of groups to add as subgroups to this group.


addVariables
public addVariables(variables: HostVariable): void

Assigns additional variables to this group.

variablesRequired

A list of variables to add to this group.


toJson
public toJson(): {[ key: string ]: any}

JSONify this group.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { HostGroup } from 'cdk-ans'

HostGroup.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
groups {[ key: string ]: HostGroup} No description.
hosts Host[] No description.
identifier string No description.
variables HostVariable[] No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


groupsRequired
public readonly groups: {[ key: string ]: HostGroup};

hostsRequired
public readonly hosts: Host[];

identifierRequired
public readonly identifier: string;
  • Type: string

variablesRequired
public readonly variables: HostVariable[];

HostVariable

Initializers

import { HostVariable } from 'cdk-ans'

new HostVariable(scope: Construct, id: string, props: HostVariableProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props HostVariableProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
asRaw Returns the variable as a raw string.
asVariable Returns the variable as an ansible variable string {{ variable }}.
index No description.
property No description.

toString
public toString(): string

Returns a string representation of this construct.

asRaw
public asRaw(): string

Returns the variable as a raw string.

asVariable
public asVariable(): string

Returns the variable as an ansible variable string {{ variable }}.

index
public index(_: number): IVariable
_Required
  • Type: number

property
public property(_: string): IVariable
_Required
  • Type: string

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { HostVariable } from 'cdk-ans'

HostVariable.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
name string No description.
value string No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


nameRequired
public readonly name: string;
  • Type: string

valueRequired
public readonly value: string;
  • Type: string

Inventory

Represents an Ansible inventory.

https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#inventory-basics-formats-hosts-and-groups

Initializers

import { Inventory } from 'cdk-ans'

new Inventory(scope: Construct, name: string, props: InventoryProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props InventoryProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Inventory } from 'cdk-ans'

Inventory.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
groups HostGroup[] No description.
hosts Host[] No description.
name string No description.
variables HostVariable[] No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


groupsRequired
public readonly groups: HostGroup[];

hostsRequired
public readonly hosts: Host[];

nameRequired
public readonly name: string;
  • Type: string

variablesRequired
public readonly variables: HostVariable[];

Play

A play is a collection of tasks and metadata to execute on a set of hosts.

Plays are chainable together to create a playbook

https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#play

Initializers

import { Play } from 'cdk-ans'

new Play(scope: Construct, name: string, props: PlayProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props PlayProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.
flattenHosts No description.
next No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any
flattenHosts
public flattenHosts(): string[]
next
public next(next: IPlayChainable): PlayDefinition
nextRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Play } from 'cdk-ans'

Play.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
chain Step[] No description.
name string No description.
hosts IHostIdentifiable[] No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
factPath string No description.
forceHandlers boolean No description.
gatherFacts boolean No description.
gatherSubset string No description.
gatherTimeout number No description.
handlers Handler[] No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
maxFailPercentage number No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
order PlayHostOrder No description.
port number No description.
postTasks TaskDefinition No description.
preTasks TaskDefinition No description.
remoteUser string No description.
roles RoleDefinition No description.
runOnce boolean No description.
serial number No description.
strategy string No description.
tags string[] No description.
tasks TaskDefinition No description.
throttle number No description.
timeout number No description.
varPrompt string[] No description.
vars {[ key: string ]: any} No description.
varsFiles string[] No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


chainRequired
public readonly chain: Step[];

nameRequired
public readonly name: string;
  • Type: string

hostsRequired
public readonly hosts: IHostIdentifiable[];

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

factPathOptional
public readonly factPath: string;
  • Type: string

forceHandlersOptional
public readonly forceHandlers: boolean;
  • Type: boolean

gatherFactsOptional
public readonly gatherFacts: boolean;
  • Type: boolean

gatherSubsetOptional
public readonly gatherSubset: string;
  • Type: string

gatherTimeoutOptional
public readonly gatherTimeout: number;
  • Type: number

handlersOptional
public readonly handlers: Handler[];

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

maxFailPercentageOptional
public readonly maxFailPercentage: number;
  • Type: number

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

orderOptional
public readonly order: PlayHostOrder;

portOptional
public readonly port: number;
  • Type: number

postTasksOptional
public readonly postTasks: TaskDefinition;

preTasksOptional
public readonly preTasks: TaskDefinition;

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

rolesOptional
public readonly roles: RoleDefinition;

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

serialOptional
public readonly serial: number;
  • Type: number

strategyOptional
public readonly strategy: string;
  • Type: string

tagsOptional
public readonly tags: string[];
  • Type: string[]

tasksOptional
public readonly tasks: TaskDefinition;

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varPromptOptional
public readonly varPrompt: string[];
  • Type: string[]

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

varsFilesOptional
public readonly varsFiles: string[];
  • Type: string[]

Playbook

Initializers

import { Playbook } from 'cdk-ans'

new Playbook(scope: Construct, name: string, props: PlaybookProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props PlaybookProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any[]

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Playbook } from 'cdk-ans'

Playbook.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
name string No description.
playDefinition PlayDefinition No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


nameRequired
public readonly name: string;
  • Type: string

playDefinitionRequired
public readonly playDefinition: PlayDefinition;

Project

Initializers

import { Project } from 'cdk-ans'

new Project(scope: Construct, name: string, props?: ProjectProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props ProjectProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsOptional

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Project } from 'cdk-ans'

Project.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
inventories Inventory[] No description.
name string No description.
playbooks Playbook[] No description.
roles Role[] No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


inventoriesRequired
public readonly inventories: Inventory[];

nameRequired
public readonly name: string;
  • Type: string

playbooksRequired
public readonly playbooks: Playbook[];

rolesRequired
public readonly roles: Role[];

Resource

Initializers

import { Resource } from 'cdk-ans'

new Resource(scope: Construct, name: string)
Name Type Description
scope constructs.Construct No description.
name string No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Resource } from 'cdk-ans'

Resource.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


Role

Initializers

import { Role } from 'cdk-ans'

new Role(scope: Construct, name: string, props: RoleProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props RoleProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
addDefaultVariables No description.
addFile No description.
addHandler No description.
addTask No description.
addTemplate No description.
addVariables No description.

toString
public toString(): string

Returns a string representation of this construct.

addDefaultVariables
public addDefaultVariables(variables: {[ key: string ]: any}): void
variablesRequired
  • Type: {[ key: string ]: any}

addFile
public addFile(file: File): void
fileRequired

addHandler
public addHandler(handler: Handler): void
handlerRequired

addTask
public addTask(task: Task): void
taskRequired

addTemplate
public addTemplate(template: TemplateFile): void
templateRequired

addVariables
public addVariables(variables: {[ key: string ]: any}): void
variablesRequired
  • Type: {[ key: string ]: any}

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Role } from 'cdk-ans'

Role.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
defaults {[ key: string ]: any} No description.
files File[] No description.
handlers Handler[] No description.
name string No description.
tasks TaskDefinition No description.
templates TemplateFile[] No description.
variables {[ key: string ]: any} No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


defaultsRequired
public readonly defaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

filesRequired
public readonly files: File[];

handlersRequired
public readonly handlers: Handler[];

nameRequired
public readonly name: string;
  • Type: string

tasksRequired
public readonly tasks: TaskDefinition;

templatesRequired
public readonly templates: TemplateFile[];

variablesRequired
public readonly variables: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

RoleTarget

Represents a targetted role for use within a playbook.

https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#role

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.
next No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any
next
public next(next: IRoleChainable): RoleDefinition
nextRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.
fromRole Creates a role target from a role.

isConstruct
import { RoleTarget } from 'cdk-ans'

RoleTarget.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


fromRole
import { RoleTarget } from 'cdk-ans'

RoleTarget.fromRole(scope: Construct, id: string, role: Role, props?: RoleTargetProps)

Creates a role target from a role.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

roleRequired

propsOptional

Properties

Name Type Description
node constructs.Node The tree node.
chain Step[] No description.
name string No description.
role Role No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
delegateFacts boolean No description.
delegateTo string No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
when Conditional No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


chainRequired
public readonly chain: Step[];

nameRequired
public readonly name: string;
  • Type: string

roleRequired
public readonly role: Role;

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

delegateFactsOptional
public readonly delegateFacts: boolean;
  • Type: boolean

delegateToOptional
public readonly delegateTo: string;
  • Type: string

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

whenOptional
public readonly when: Conditional;

Step

Initializers

import { Step } from 'cdk-ans'

new Step(scope: Construct, name: string, props: StepProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props StepProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Step } from 'cdk-ans'

Step.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
chain Step[] No description.
name string No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


chainRequired
public readonly chain: Step[];

nameRequired
public readonly name: string;
  • Type: string

Task

Initializers

import { Task } from 'cdk-ans'

new Task(scope: Construct, name: string, props: TaskProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props TaskProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.
next No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any
next
public next(next: ITaskChainable): TaskDefinition
nextRequired

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Task } from 'cdk-ans'

Task.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
chain Step[] No description.
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
action TaskAction No description.
args {[ key: string ]: any} No description.
async number No description.
changedWhen string No description.
delay number No description.
delegateFacts boolean No description.
delegateTo string No description.
failedWhen Conditional[] No description.
localAction string No description.
loop string | string[] No description.
loopControl {[ key: string ]: any} No description.
notify Handler[] No description.
poll number No description.
register string No description.
retries number No description.
until string No description.
when Conditional No description.
with string[] No description.
withItems {[ key: string ]: any}[] No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


chainRequired
public readonly chain: Step[];

nameRequired
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

actionRequired
public readonly action: TaskAction;

argsOptional
public readonly args: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

asyncOptional
public readonly async: number;
  • Type: number

changedWhenOptional
public readonly changedWhen: string;
  • Type: string

delayOptional
public readonly delay: number;
  • Type: number

delegateFactsOptional
public readonly delegateFacts: boolean;
  • Type: boolean

delegateToOptional
public readonly delegateTo: string;
  • Type: string

failedWhenOptional
public readonly failedWhen: Conditional[];

localActionOptional
public readonly localAction: string;
  • Type: string

loopOptional
public readonly loop: string | string[];
  • Type: string | string[]

loopControlOptional
public readonly loopControl: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

notifyOptional
public readonly notify: Handler[];

pollOptional
public readonly poll: number;
  • Type: number

registerOptional
public readonly register: string;
  • Type: string

retriesOptional
public readonly retries: number;
  • Type: number

untilOptional
public readonly until: string;
  • Type: string

whenOptional
public readonly when: Conditional;

withOptional
public readonly with: string[];
  • Type: string[]

withItemsOptional
public readonly withItems: {[ key: string ]: any}[];
  • Type: {[ key: string ]: any}[]

TaskBase

Initializers

import { TaskBase } from 'cdk-ans'

new TaskBase(scope: Construct, name: string, props: TaskBaseProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props TaskBaseProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
toJson No description.

toString
public toString(): string

Returns a string representation of this construct.

toJson
public toJson(): any

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { TaskBase } from 'cdk-ans'

TaskBase.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
chain Step[] No description.
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


chainRequired
public readonly chain: Step[];

nameRequired
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

TemplateFile

Initializers

import { TemplateFile } from 'cdk-ans'

new TemplateFile(scope: Construct, name: string, props: TemplateFileProps)
Name Type Description
scope constructs.Construct No description.
name string No description.
props TemplateFileProps No description.

scopeRequired
  • Type: constructs.Construct

nameRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { TemplateFile } from 'cdk-ans'

TemplateFile.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
fileName string No description.
path string No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


fileNameRequired
public readonly fileName: string;
  • Type: string

pathRequired
public readonly path: string;
  • Type: string

Structs

AppProps

Initializer

import { AppProps } from 'cdk-ans'

const appProps: AppProps = { ... }

Properties

Name Type Description
outdir string No description.
synthesizer ISynthesizer No description.

outdirOptional
public readonly outdir: string;
  • Type: string
  • Default: CDKANS_OUTDIR if defined, otherwise "dist"

synthesizerOptional
public readonly synthesizer: ISynthesizer;

BlockProps

Initializer

import { BlockProps } from 'cdk-ans'

const blockProps: BlockProps = { ... }

Properties

Name Type Description
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
tasks TaskDefinition No description.
always TaskDefinition No description.
delegateFacts boolean No description.
delegateTo string No description.
notify Handler[] No description.
rescue TaskDefinition No description.
when Conditional No description.

nameOptional
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

tasksRequired
public readonly tasks: TaskDefinition;

alwaysOptional
public readonly always: TaskDefinition;

delegateFactsOptional
public readonly delegateFacts: boolean;
  • Type: boolean

delegateToOptional
public readonly delegateTo: string;
  • Type: string

notifyOptional
public readonly notify: Handler[];

rescueOptional
public readonly rescue: TaskDefinition;

whenOptional
public readonly when: Conditional;

FileProps

Initializer

import { FileProps } from 'cdk-ans'

const fileProps: FileProps = { ... }

Properties

Name Type Description
path string No description.
fileName string No description.

pathRequired
public readonly path: string;
  • Type: string

fileNameOptional
public readonly fileName: string;
  • Type: string

HandlerProps

Initializer

import { HandlerProps } from 'cdk-ans'

const handlerProps: HandlerProps = { ... }

Properties

Name Type Description
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
action TaskAction No description.
listen string No description.

nameOptional
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

actionRequired
public readonly action: TaskAction;

listenOptional
public readonly listen: string;
  • Type: string

HostGroupProps

Properties for a host group.

Initializer

import { HostGroupProps } from 'cdk-ans'

const hostGroupProps: HostGroupProps = { ... }

Properties

Name Type Description
groups HostGroup[] Subgroups of this group.
hosts Host[] Hosts in this group.
identifier string The identifier of the group.
variables HostVariable[] Variables that will be set on all hosts in this group.

groupsOptional
public readonly groups: HostGroup[];

Subgroups of this group.


hostsOptional
public readonly hosts: Host[];

Hosts in this group.


identifierOptional
public readonly identifier: string;
  • Type: string

The identifier of the group.


variablesOptional
public readonly variables: HostVariable[];

Variables that will be set on all hosts in this group.


HostProps

Configuration for a host in an Ansible inventory.

Initializer

import { HostProps } from 'cdk-ans'

const hostProps: HostProps = { ... }

Properties

Name Type Description
host string The hostname or IP address of the host.
ansibleBecome boolean Whether to become privileged.
ansiblePassword string The password to use to connect to the host.
ansiblePort number The port to connect to on the remote host.
ansibleUser string The user to connect to the host as.
connectionType AnsibleConnection The connection type to use to connect to the host.
identifier string The identifier of the host on synthesis.
variables HostVariable[] Additional variables to set for the host.

hostRequired
public readonly host: string;
  • Type: string

The hostname or IP address of the host.


ansibleBecomeOptional
public readonly ansibleBecome: boolean;
  • Type: boolean
  • Default: no become

Whether to become privileged.

https://docs.ansible.com/ansible/latest/user_guide/become.html


ansiblePasswordOptional
public readonly ansiblePassword: string;
  • Type: string
  • Default: no password

The password to use to connect to the host.

https://docs.ansible.com/ansible/latest/user_guide/connection_details.html#ssh-connection-variables


ansiblePortOptional
public readonly ansiblePort: number;
  • Type: number
  • Default: the default port for the connection type

The port to connect to on the remote host.

https://docs.ansible.com/ansible/latest/user_guide/connection_details.html#connection-types


ansibleUserOptional
public readonly ansibleUser: string;
  • Type: string

The user to connect to the host as.


connectionTypeOptional
public readonly connectionType: AnsibleConnection;

The connection type to use to connect to the host.


identifierOptional
public readonly identifier: string;
  • Type: string
  • Default: the construct's id

The identifier of the host on synthesis.


variablesOptional
public readonly variables: HostVariable[];

Additional variables to set for the host.


HostVariableProps

Initializer

import { HostVariableProps } from 'cdk-ans'

const hostVariableProps: HostVariableProps = { ... }

Properties

Name Type Description
name string No description.
value string No description.

nameRequired
public readonly name: string;
  • Type: string

valueRequired
public readonly value: string;
  • Type: string

InventoryProps

Properties for an Ansible inventory.

Initializer

import { InventoryProps } from 'cdk-ans'

const inventoryProps: InventoryProps = { ... }

Properties

Name Type Description
groups HostGroup[] Groups in the inventory.
hosts Host[] Hosts in the inventory.
name string The name of the inventory.
variables HostVariable[] Inventory level variables that will be set on all hosts.

groupsOptional
public readonly groups: HostGroup[];

Groups in the inventory.


hostsOptional
public readonly hosts: Host[];

Hosts in the inventory.

Hosts added here are part of the top level "all" group.


nameOptional
public readonly name: string;
  • Type: string
  • Default: the name of the construct.

The name of the inventory.


variablesOptional
public readonly variables: HostVariable[];

Inventory level variables that will be set on all hosts.

https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html#adding-variables-to-inventory


PlaybookProps

Initializer

import { PlaybookProps } from 'cdk-ans'

const playbookProps: PlaybookProps = { ... }

Properties

Name Type Description
playDefinition PlayDefinition No description.
name string No description.

playDefinitionRequired
public readonly playDefinition: PlayDefinition;

nameOptional
public readonly name: string;
  • Type: string

PlayProps

Initializer

import { PlayProps } from 'cdk-ans'

const playProps: PlayProps = { ... }

Properties

Name Type Description
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
hosts IHostIdentifiable[] No description.
factPath string No description.
forceHandlers boolean No description.
gatherFacts boolean No description.
gatherSubset string No description.
gatherTimeout number No description.
handlers Handler[] No description.
maxFailPercentage number No description.
order PlayHostOrder No description.
postTasks TaskDefinition No description.
preTasks TaskDefinition No description.
roles RoleDefinition No description.
serial number No description.
strategy string No description.
tasks TaskDefinition No description.
varPrompt string[] No description.
varsFiles string[] No description.

nameOptional
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

hostsRequired
public readonly hosts: IHostIdentifiable[];

factPathOptional
public readonly factPath: string;
  • Type: string

forceHandlersOptional
public readonly forceHandlers: boolean;
  • Type: boolean

gatherFactsOptional
public readonly gatherFacts: boolean;
  • Type: boolean

gatherSubsetOptional
public readonly gatherSubset: string;
  • Type: string

gatherTimeoutOptional
public readonly gatherTimeout: number;
  • Type: number

handlersOptional
public readonly handlers: Handler[];

maxFailPercentageOptional
public readonly maxFailPercentage: number;
  • Type: number

orderOptional
public readonly order: PlayHostOrder;

postTasksOptional
public readonly postTasks: TaskDefinition;

preTasksOptional
public readonly preTasks: TaskDefinition;

rolesOptional
public readonly roles: RoleDefinition;

serialOptional
public readonly serial: number;
  • Type: number

strategyOptional
public readonly strategy: string;
  • Type: string

tasksOptional
public readonly tasks: TaskDefinition;

varPromptOptional
public readonly varPrompt: string[];
  • Type: string[]

varsFilesOptional
public readonly varsFiles: string[];
  • Type: string[]

ProjectProps

Initializer

import { ProjectProps } from 'cdk-ans'

const projectProps: ProjectProps = { ... }

Properties

Name Type Description
name string No description.

nameOptional
public readonly name: string;
  • Type: string

ProjectSynthesizerOptions

Options on how the project synthezier should behave when synthesizing a project.

Initializer

import { ProjectSynthesizerOptions } from 'cdk-ans'

const projectSynthesizerOptions: ProjectSynthesizerOptions = { ... }

Properties

Name Type Description
inventoryOptions SynthesizeInventoryOptions Options on how to synthesize inventories.
playbookOptions SynthesizePlaybookOptions Options on how to synthesize playbooks.
roleOptions SynthesizeRoleOptions Options on how to synthesize roles.

inventoryOptionsOptional
public readonly inventoryOptions: SynthesizeInventoryOptions;

Options on how to synthesize inventories.


playbookOptionsOptional
public readonly playbookOptions: SynthesizePlaybookOptions;

Options on how to synthesize playbooks.


roleOptionsOptional
public readonly roleOptions: SynthesizeRoleOptions;

Options on how to synthesize roles.


RoleProps

Initializer

import { RoleProps } from 'cdk-ans'

const roleProps: RoleProps = { ... }

Properties

Name Type Description
tasks TaskDefinition No description.
defaults {[ key: string ]: any} No description.
files File[] No description.
handlers Handler[] No description.
name string No description.
templates TemplateFile[] No description.
variables {[ key: string ]: any} No description.

tasksRequired
public readonly tasks: TaskDefinition;

defaultsOptional
public readonly defaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

filesOptional
public readonly files: File[];

handlersOptional
public readonly handlers: Handler[];

nameOptional
public readonly name: string;
  • Type: string

templatesOptional
public readonly templates: TemplateFile[];

variablesOptional
public readonly variables: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

RoleTargetProps

Initializer

import { RoleTargetProps } from 'cdk-ans'

const roleTargetProps: RoleTargetProps = { ... }

Properties

Name Type Description
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
delegateFacts boolean No description.
delegateTo string No description.
when Conditional No description.

nameOptional
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

delegateFactsOptional
public readonly delegateFacts: boolean;
  • Type: boolean

delegateToOptional
public readonly delegateTo: string;
  • Type: string

whenOptional
public readonly when: Conditional;

StepProps

Initializer

import { StepProps } from 'cdk-ans'

const stepProps: StepProps = { ... }

Properties

Name Type Description
name string No description.

nameOptional
public readonly name: string;
  • Type: string

SynthesizeInventoryOptions

Initializer

import { SynthesizeInventoryOptions } from 'cdk-ans'

const synthesizeInventoryOptions: SynthesizeInventoryOptions = { ... }

Properties

Name Type Description
inventoryOutputType InventoryOutputType How to organzie inventory output.
outDir string Where synthezied roles should be saved.

inventoryOutputTypeOptional
public readonly inventoryOutputType: InventoryOutputType;

How to organzie inventory output.


outDirOptional
public readonly outDir: string;
  • Type: string
  • Default: inventories

Where synthezied roles should be saved.


SynthesizePlaybookOptions

Initializer

import { SynthesizePlaybookOptions } from 'cdk-ans'

const synthesizePlaybookOptions: SynthesizePlaybookOptions = { ... }

Properties

Name Type Description
outDir string Where synthezied playbooks should be saved.
playbookOutputType PlaybookOutputType How to organzie playbook output.

outDirOptional
public readonly outDir: string;
  • Type: string
  • Default: projects

Where synthezied playbooks should be saved.

Only used if playbookOutputType is PlaybookOutputType.IN_DIRECTORY


playbookOutputTypeOptional
public readonly playbookOutputType: PlaybookOutputType;

How to organzie playbook output.


SynthesizeRoleOptions

Initializer

import { SynthesizeRoleOptions } from 'cdk-ans'

const synthesizeRoleOptions: SynthesizeRoleOptions = { ... }

Properties

Name Type Description
outDir string Where synthezied roles should be saved.
roleOutputType RoleOutputType How to organzie role output.

outDirOptional
public readonly outDir: string;
  • Type: string
  • Default: roles

Where synthezied roles should be saved.


roleOutputTypeOptional
public readonly roleOutputType: RoleOutputType;

How to organzie role output.


TaskActionProps

An empty interface TaskActionProps extends from This is a placeholder incase there are base settings ever needed for an Action.

Initializer

import { TaskActionProps } from 'cdk-ans'

const taskActionProps: TaskActionProps = { ... }

TaskBaseProps

Initializer

import { TaskBaseProps } from 'cdk-ans'

const taskBaseProps: TaskBaseProps = { ... }

Properties

Name Type Description
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.

nameOptional
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

TaskProps

Initializer

import { TaskProps } from 'cdk-ans'

const taskProps: TaskProps = { ... }

Properties

Name Type Description
name string No description.
anyErrorsFatal boolean No description.
become boolean No description.
becomeExe string No description.
becomeFlags string No description.
becomeMethod string No description.
becomeUser string No description.
checkMode boolean No description.
collections string[] No description.
connection string No description.
debugger boolean No description.
diff boolean No description.
environment {[ key: string ]: any} No description.
ignoreErrors boolean No description.
ignoreUnreachable boolean No description.
moduleDefaults {[ key: string ]: any} No description.
noLog boolean No description.
port number No description.
remoteUser string No description.
runOnce boolean No description.
tags string[] No description.
throttle number No description.
timeout number No description.
vars {[ key: string ]: any} No description.
action TaskAction No description.
args {[ key: string ]: any} No description.
async number No description.
changedWhen string No description.
delay number No description.
delegateFacts boolean No description.
delegateTo string No description.
failedWhen Conditional[] No description.
localAction string No description.
loop string | string[] No description.
loopControl {[ key: string ]: any} No description.
notify Handler[] No description.
poll number No description.
register string No description.
retries number No description.
until string No description.
when Conditional No description.
with string[] No description.
withItems {[ key: string ]: any}[] No description.

nameOptional
public readonly name: string;
  • Type: string

anyErrorsFatalOptional
public readonly anyErrorsFatal: boolean;
  • Type: boolean

becomeOptional
public readonly become: boolean;
  • Type: boolean

becomeExeOptional
public readonly becomeExe: string;
  • Type: string

becomeFlagsOptional
public readonly becomeFlags: string;
  • Type: string

becomeMethodOptional
public readonly becomeMethod: string;
  • Type: string

becomeUserOptional
public readonly becomeUser: string;
  • Type: string

checkModeOptional
public readonly checkMode: boolean;
  • Type: boolean

collectionsOptional
public readonly collections: string[];
  • Type: string[]

connectionOptional
public readonly connection: string;
  • Type: string

debuggerOptional
public readonly debugger: boolean;
  • Type: boolean

diffOptional
public readonly diff: boolean;
  • Type: boolean

environmentOptional
public readonly environment: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

ignoreErrorsOptional
public readonly ignoreErrors: boolean;
  • Type: boolean

ignoreUnreachableOptional
public readonly ignoreUnreachable: boolean;
  • Type: boolean

moduleDefaultsOptional
public readonly moduleDefaults: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

noLogOptional
public readonly noLog: boolean;
  • Type: boolean

portOptional
public readonly port: number;
  • Type: number

remoteUserOptional
public readonly remoteUser: string;
  • Type: string

runOnceOptional
public readonly runOnce: boolean;
  • Type: boolean

tagsOptional
public readonly tags: string[];
  • Type: string[]

throttleOptional
public readonly throttle: number;
  • Type: number

timeoutOptional
public readonly timeout: number;
  • Type: number

varsOptional
public readonly vars: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

actionRequired
public readonly action: TaskAction;

argsOptional
public readonly args: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

asyncOptional
public readonly async: number;
  • Type: number

changedWhenOptional
public readonly changedWhen: string;
  • Type: string

delayOptional
public readonly delay: number;
  • Type: number

delegateFactsOptional
public readonly delegateFacts: boolean;
  • Type: boolean

delegateToOptional
public readonly delegateTo: string;
  • Type: string

failedWhenOptional
public readonly failedWhen: Conditional[];

localActionOptional
public readonly localAction: string;
  • Type: string

loopOptional
public readonly loop: string | string[];
  • Type: string | string[]

loopControlOptional
public readonly loopControl: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

notifyOptional
public readonly notify: Handler[];

pollOptional
public readonly poll: number;
  • Type: number

registerOptional
public readonly register: string;
  • Type: string

retriesOptional
public readonly retries: number;
  • Type: number

untilOptional
public readonly until: string;
  • Type: string

whenOptional
public readonly when: Conditional;

withOptional
public readonly with: string[];
  • Type: string[]

withItemsOptional
public readonly withItems: {[ key: string ]: any}[];
  • Type: {[ key: string ]: any}[]

TemplateFileProps

Initializer

import { TemplateFileProps } from 'cdk-ans'

const templateFileProps: TemplateFileProps = { ... }

Properties

Name Type Description
path string No description.
fileName string No description.

pathRequired
public readonly path: string;
  • Type: string

fileNameOptional
public readonly fileName: string;
  • Type: string

Classes

AllHosts

A special host identifier that contains all hosts.

Used from the Hosts.All class

Initializers

import { AllHosts } from 'cdk-ans'

new AllHosts()
Name Type Description

Properties

Name Type Description
identifier string No description.

identifierRequired
public readonly identifier: string;
  • Type: string

AnyVariable

A variable that can be used to access any type of variable.

Used by returns of property and index methods of other variables.

Initializers

import { AnyVariable } from 'cdk-ans'

new AnyVariable(name: string, parents?: string[])
Name Type Description
name string No description.
parents string[] No description.

nameRequired
  • Type: string

parentsOptional
  • Type: string[]

Methods

Name Description
asRaw Returns the variable as a raw string.
asVariable Returns the variable as an ansible variable string {{ variable }}.
index No description.
property No description.

asRaw
public asRaw(): string

Returns the variable as a raw string.

asVariable
public asVariable(): string

Returns the variable as an ansible variable string {{ variable }}.

index
public index(index: number): IVariable
indexRequired
  • Type: number

property
public property(key: string): IVariable
keyRequired
  • Type: string

Static Functions

Name Description
of No description.

of
import { AnyVariable } from 'cdk-ans'

AnyVariable.of(name: string)
nameRequired
  • Type: string

Properties

Name Type Description
name string No description.
parents string[] No description.

nameRequired
public readonly name: string;
  • Type: string

parentsRequired
public readonly parents: string[];
  • Type: string[]

BaseVariable

The base variable class that all other variables extend from.

Initializers

import { BaseVariable } from 'cdk-ans'

new BaseVariable(name: string, parents?: string[])
Name Type Description
name string No description.
parents string[] No description.

nameRequired
  • Type: string

parentsOptional
  • Type: string[]

Methods

Name Description
asRaw Returns the variable as a raw string.
asVariable Returns the variable as an ansible variable string {{ variable }}.
index No description.
property No description.

asRaw
public asRaw(): string

Returns the variable as a raw string.

asVariable
public asVariable(): string

Returns the variable as an ansible variable string {{ variable }}.

index
public index(index: number): IVariable
indexRequired
  • Type: number

property
public property(name: string): IVariable
nameRequired
  • Type: string

Properties

Name Type Description
name string No description.
parents string[] No description.

nameRequired
public readonly name: string;
  • Type: string

parentsRequired
public readonly parents: string[];
  • Type: string[]

Conditional

Methods

Name Description
format No description.

format
public format(): string

Static Functions

Name Description
and No description.
bool No description.
equal No description.
greaterThan No description.
greaterThanOrEqual No description.
in No description.
is No description.
isNot No description.
lessThan No description.
lessThanOrEqual No description.
notBool No description.
notEqual No description.
notIn No description.
or No description.

and
import { Conditional } from 'cdk-ans'

Conditional.and(condition1: any, condition2: any)
condition1Required
  • Type: any

condition2Required
  • Type: any

bool
import { Conditional } from 'cdk-ans'

Conditional.bool(bool: any)
boolRequired
  • Type: any

equal
import { Conditional } from 'cdk-ans'

Conditional.equal(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

greaterThan
import { Conditional } from 'cdk-ans'

Conditional.greaterThan(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

greaterThanOrEqual
import { Conditional } from 'cdk-ans'

Conditional.greaterThanOrEqual(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

in
import { Conditional } from 'cdk-ans'

Conditional.in(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

is
import { Conditional } from 'cdk-ans'

Conditional.is(var1: any, isEval: IsEvaluation)
var1Required
  • Type: any

isEvalRequired

isNot
import { Conditional } from 'cdk-ans'

Conditional.isNot(var1: any, isEval: IsEvaluation)
var1Required
  • Type: any

isEvalRequired

lessThan
import { Conditional } from 'cdk-ans'

Conditional.lessThan(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

lessThanOrEqual
import { Conditional } from 'cdk-ans'

Conditional.lessThanOrEqual(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

notBool
import { Conditional } from 'cdk-ans'

Conditional.notBool(bool: any)
boolRequired
  • Type: any

notEqual
import { Conditional } from 'cdk-ans'

Conditional.notEqual(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

notIn
import { Conditional } from 'cdk-ans'

Conditional.notIn(var1: any, var2: any)
var1Required
  • Type: any

var2Required
  • Type: any

or
import { Conditional } from 'cdk-ans'

Conditional.or(condition1: any, condition2: any)
condition1Required
  • Type: any

condition2Required
  • Type: any

Properties

Name Type Description
mode ConditionalEvaluation No description.
var1 any No description.
var2 any No description.

modeRequired
public readonly mode: ConditionalEvaluation;

var1Required
public readonly var1: any;
  • Type: any

var2Optional
public readonly var2: any;
  • Type: any

DependencyGraph

Represents the dependency graph for a given Node.

This graph includes the dependency relationships between all nodes in the node (construct) sub-tree who's root is this Node.

Note that this means that lonely nodes (no dependencies and no dependants) are also included in this graph as childless children of the root node of the graph.

The graph does not include cross-scope dependencies. That is, if a child on the current scope depends on a node from a different scope, that relationship is not represented in this graph.

Initializers

import { DependencyGraph } from 'cdk-ans'

new DependencyGraph(node: Node)
Name Type Description
node constructs.Node No description.

nodeRequired
  • Type: constructs.Node

Methods

Name Description
topology No description.

topology
public topology(): IConstruct[]

Vertex.topology ()

Properties

Name Type Description
root DependencyVertex Returns the root of the graph.

rootRequired
public readonly root: DependencyVertex;

Returns the root of the graph.

Note that this vertex will always have null as its .value since it is an artifical root that binds all the connected spaces of the graph.


DependencyVertex

Represents a vertex in the graph.

The value of each vertex is an IConstruct that is accessible via the .value getter.

Initializers

import { DependencyVertex } from 'cdk-ans'

new DependencyVertex(value?: IConstruct)
Name Type Description
value constructs.IConstruct No description.

valueOptional
  • Type: constructs.IConstruct

Methods

Name Description
addChild Adds a vertex as a dependency of the current node.
topology Returns a topologically sorted array of the constructs in the sub-graph.

addChild
public addChild(dep: DependencyVertex): void

Adds a vertex as a dependency of the current node.

Also updates the parents of dep, so that it contains this node as a parent.

This operation will fail in case it creates a cycle in the graph.

depRequired

The dependency.


topology
public topology(): IConstruct[]

Returns a topologically sorted array of the constructs in the sub-graph.

Properties

Name Type Description
inbound DependencyVertex[] Returns the parents of the vertex (i.e dependants).
outbound DependencyVertex[] Returns the children of the vertex (i.e dependencies).
value constructs.IConstruct Returns the IConstruct this graph vertex represents.

inboundRequired
public readonly inbound: DependencyVertex[];

Returns the parents of the vertex (i.e dependants).


outboundRequired
public readonly outbound: DependencyVertex[];

Returns the children of the vertex (i.e dependencies).


valueOptional
public readonly value: IConstruct;
  • Type: constructs.IConstruct

Returns the IConstruct this graph vertex represents.

null in case this is the root of the graph.


DictionaryVariable

A variable that represents a dictionary (object) This can be used to access properties of the dictionary.

Initializers

import { DictionaryVariable } from 'cdk-ans'

new DictionaryVariable(name: string, parents?: string[])
Name Type Description
name string No description.
parents string[] No description.

nameRequired
  • Type: string

parentsOptional
  • Type: string[]

Methods

Name Description
asRaw Returns the variable as a raw string.
asVariable Returns the variable as an ansible variable string {{ variable }}.
index No description.
property No description.

asRaw
public asRaw(): string

Returns the variable as a raw string.

asVariable
public asVariable(): string

Returns the variable as an ansible variable string {{ variable }}.

index
public index(_: number): IVariable
_Required
  • Type: number

property
public property(key: string): IVariable
keyRequired
  • Type: string

Static Functions

Name Description
of No description.

of
import { DictionaryVariable } from 'cdk-ans'

DictionaryVariable.of(name: string)
nameRequired
  • Type: string

Properties

Name Type Description
name string No description.
parents string[] No description.

nameRequired
public readonly name: string;
  • Type: string

parentsRequired
public readonly parents: string[];
  • Type: string[]

Hosts

A special class to allow for specifying all hosts in a playbook.

Initializers

import { Hosts } from 'cdk-ans'

new Hosts()
Name Type Description

Constants

Name Type Description
All AllHosts[] No description.

AllRequired
public readonly All: AllHosts[];

ListVariable

A variable that can be used to access a indexed sub variables.

Initializers

import { ListVariable } from 'cdk-ans'

new ListVariable(name: string, parents?: string[])
Name Type Description
name string No description.
parents string[] No description.

nameRequired
  • Type: string

parentsOptional
  • Type: string[]

Methods

Name Description
asRaw Returns the variable as a raw string.
asVariable Returns the variable as an ansible variable string {{ variable }}.
index No description.
property No description.

asRaw
public asRaw(): string

Returns the variable as a raw string.

asVariable
public asVariable(): string

Returns the variable as an ansible variable string {{ variable }}.

index
public index(index: number): IVariable
indexRequired
  • Type: number

property
public property(_: string): IVariable
_Required
  • Type: string

Static Functions

Name Description
of No description.

of
import { ListVariable } from 'cdk-ans'

ListVariable.of(name: string)
nameRequired
  • Type: string

Properties

Name Type Description
name string No description.
parents string[] No description.

nameRequired
public readonly name: string;
  • Type: string

parentsRequired
public readonly parents: string[];
  • Type: string[]

MagicVariable

Ansible magic variable.

A class used to format anisble variables.

https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html

Initializers

import { MagicVariable } from 'cdk-ans'

new MagicVariable()
Name Type Description

Constants

Name Type Description
AnsibleBecomeUser SimpleVariable The user Ansible ‘becomes’ after using privilege escalation.
AnsibleCheckMode SimpleVariable Boolean that indicates if we are in check mode or not.
AnsibleCheckModeEnabled SimpleVariable The names of the roles currently imported into the current play as dependencies of other plays.
AnsibleCollectionName SimpleVariable The name of the collection the task that is executing is a part of.
AnsibleConfigFile SimpleVariable The full path of used Ansible configuration file.
AnsibleConnection SimpleVariable The connection plugin actually used for the task on the target host.
AnsibleDiffMode SimpleVariable Boolean that indicates if we are in diff mode or not.
AnsibleFacts DictionaryVariable Contains any facts gathered or cached for the inventory_hostname Facts are normally gathered by the setup module automatically in a play, but any module can return facts.
AnsibleForks SimpleVariable Integer reflecting the number of maximum forks available to this run.
AnsibleHost SimpleVariable The ip/name of the target host to use instead of inventory_hostname.
AnsibleIndexVar SimpleVariable The name of the value provided to loop_control.index_var. Added in 2.9.
AnsibleInventorySources ListVariable List of sources used as inventory.
AnsibleLimit SimpleVariable Contents of the --limit CLI option for the current execution of Ansible.
AnsibleLocal DictionaryVariable Contains any ‘local facts’ gathered or cached for the inventory_hostname.
AnsibleLoop DictionaryVariable A dictionary/map containing extended loop information when enabled through loop_control.extended.
AnsibleLoopVar SimpleVariable The name of the value provided to loop_control.loop_var. Added in 2.8.
AnsibleParentRoleNames ListVariable When the current role is being executed by means of an include_role or import_role action, this variable contains a list of all parent roles, with the most recent role (in other words, the role that included/imported this role) being the first item in the list.
AnsibleParentRolePath SimpleVariable When the current role is being executed by means of an include_role or import_role action, this variable contains a list of all parent roles paths, with the most recent role (in other words, the role that included/imported this role) being the first item in the list.
AnsiblePlayBatch ListVariable List of active hosts in the current play run limited by the serial, aka ‘batch’.
AnsiblePlaybookPython SimpleVariable The path to the python interpreter being used by Ansible on the controller.
AnsiblePlayHosts ListVariable List of hosts in the current play run, not limited by the serial.
AnsiblePlayHostsAll ListVariable List of all the hosts that were targeted by the play.
AnsiblePlayName SimpleVariable The name of the currently executed play.
AnsiblePlayRoleNames ListVariable The names of the roles currently imported into the current play.
AnsiblePort SimpleVariable The port used to connect to the target host.
AnsiblePythonInterpreter SimpleVariable The path to the Python executable Ansible should use on the target host.
AnsibleRoleName SimpleVariable The fully qualified collection role name, in the format of namespace.collection.role_name.
AnsibleRoleNames ListVariable The names of the roles currently imported into the current play, or roles referenced as dependencies of the roles imported into the current play.
AnsibleRunTags ListVariable Contents of the --tags CLI option, which specifies which tags will be included for the current run.
AnsibleSearchPath SimpleVariable Current search path for action plugins and lookups, in other words, where we search for relative paths when you do template: src=myfile.
AnsibleSkipTags ListVariable Contents of the --skip-tags CLI option, which specifies which tags will be skipped for the current run.
AnsibleUser SimpleVariable The user Ansible ‘logs in’ as.
AnsibleVerbosity SimpleVariable Current verbosity setting for Ansible.
AnsibleVersion SimpleVariable Dictionary/map that contains information about the current running version of ansible, it has the following keys: full, major, minor, revision and string.
GroupNames ListVariable List of groups the current host is part of.
Groups DictionaryVariable A dictionary/map with all the groups in inventory and each group has the list of hosts that belong to it.
HostVars DictionaryVariable A dictionary/map with all the hosts in inventory and variables assigned to them.
InventoryDir SimpleVariable The directory of the inventory source in which the inventory_hostname was first defined.
InventoryFile SimpleVariable The file name of the inventory source in which the inventory_hostname was first defined.
InventoryHostname SimpleVariable The inventory name for the ‘current’ host being iterated over in the play.
InventoryHostnameShort SimpleVariable The short version of inventory_hostname.
Item AnyVariable A special variable to quickly implement an item variable in a loop.
Omit SimpleVariable Special variable that allows you to ‘omit’ an option in a task, for example - user: name=bob home={{ bobs_home\|default(omit) }}.
PlaybookDir SimpleVariable The path to the directory of the current playbook being executed.
RoleName SimpleVariable The name of the role currently being executed.
RolePath SimpleVariable The path to the dir of the currently running role.

AnsibleBecomeUserRequired
public readonly AnsibleBecomeUser: SimpleVariable;

The user Ansible ‘becomes’ after using privilege escalation.

This must be available to the ‘login user’.


AnsibleCheckModeRequired
public readonly AnsibleCheckMode: SimpleVariable;

Boolean that indicates if we are in check mode or not.


AnsibleCheckModeEnabledRequired
public readonly AnsibleCheckModeEnabled: SimpleVariable;

The names of the roles currently imported into the current play as dependencies of other plays.


AnsibleCollectionNameRequired
public readonly AnsibleCollectionName: SimpleVariable;

The name of the collection the task that is executing is a part of.

In the format of namespace.collection.


AnsibleConfigFileRequired
public readonly AnsibleConfigFile: SimpleVariable;

The full path of used Ansible configuration file.


AnsibleConnectionRequired
public readonly AnsibleConnection: SimpleVariable;

The connection plugin actually used for the task on the target host.


AnsibleDiffModeRequired
public readonly AnsibleDiffMode: SimpleVariable;

Boolean that indicates if we are in diff mode or not.


AnsibleFactsRequired
public readonly AnsibleFacts: DictionaryVariable;

Contains any facts gathered or cached for the inventory_hostname Facts are normally gathered by the setup module automatically in a play, but any module can return facts.

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/setup_module.html


AnsibleForksRequired
public readonly AnsibleForks: SimpleVariable;

Integer reflecting the number of maximum forks available to this run.


AnsibleHostRequired
public readonly AnsibleHost: SimpleVariable;

The ip/name of the target host to use instead of inventory_hostname.


AnsibleIndexVarRequired
public readonly AnsibleIndexVar: SimpleVariable;

The name of the value provided to loop_control.index_var. Added in 2.9.


AnsibleInventorySourcesRequired
public readonly AnsibleInventorySources: ListVariable;

List of sources used as inventory.


AnsibleLimitRequired
public readonly AnsibleLimit: SimpleVariable;

Contents of the --limit CLI option for the current execution of Ansible.


AnsibleLocalRequired
public readonly AnsibleLocal: DictionaryVariable;

Contains any ‘local facts’ gathered or cached for the inventory_hostname.

The keys available depend on the custom facts created. See the setup module and facts.d or local facts for more details.


AnsibleLoopRequired
public readonly AnsibleLoop: DictionaryVariable;

A dictionary/map containing extended loop information when enabled through loop_control.extended.


AnsibleLoopVarRequired
public readonly AnsibleLoopVar: SimpleVariable;

The name of the value provided to loop_control.loop_var. Added in 2.8.


AnsibleParentRoleNamesRequired
public readonly AnsibleParentRoleNames: ListVariable;

When the current role is being executed by means of an include_role or import_role action, this variable contains a list of all parent roles, with the most recent role (in other words, the role that included/imported this role) being the first item in the list.

When multiple inclusions occur, this list lists the last role (in other words, the role that included this role) as the first item in the list. It is also possible that a specific role exists more than once in this list.

For example: When role A includes role B, inside role B, ansible_parent_role_names will equal to ['A']. If role B then includes role C, the list becomes ['B', 'A'].

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/import_role_module.html


AnsibleParentRolePathRequired
public readonly AnsibleParentRolePath: SimpleVariable;

When the current role is being executed by means of an include_role or import_role action, this variable contains a list of all parent roles paths, with the most recent role (in other words, the role that included/imported this role) being the first item in the list.

Please refer to ansible_parent_role_names for the order of items in this list.

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/import_role_module.html


AnsiblePlayBatchRequired
public readonly AnsiblePlayBatch: ListVariable;

List of active hosts in the current play run limited by the serial, aka ‘batch’.

Failed/Unreachable hosts are not considered ‘active’.


AnsiblePlaybookPythonRequired
public readonly AnsiblePlaybookPython: SimpleVariable;

The path to the python interpreter being used by Ansible on the controller.


AnsiblePlayHostsRequired
public readonly AnsiblePlayHosts: ListVariable;

List of hosts in the current play run, not limited by the serial.

Failed/Unreachable hosts are excluded from this list.


AnsiblePlayHostsAllRequired
public readonly AnsiblePlayHostsAll: ListVariable;

List of all the hosts that were targeted by the play.


AnsiblePlayNameRequired
public readonly AnsiblePlayName: SimpleVariable;

The name of the currently executed play.

Added in 2.8. (name attribute of the play, not file name of the playbook.)


AnsiblePlayRoleNamesRequired
public readonly AnsiblePlayRoleNames: ListVariable;

The names of the roles currently imported into the current play.

This list does not contain the role names that are implicitly included through dependencies.


AnsiblePortRequired
public readonly AnsiblePort: SimpleVariable;

The port used to connect to the target host.


AnsiblePythonInterpreterRequired
public readonly AnsiblePythonInterpreter: SimpleVariable;

The path to the Python executable Ansible should use on the target host.

https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html


AnsibleRoleNameRequired
public readonly AnsibleRoleName: SimpleVariable;

The fully qualified collection role name, in the format of namespace.collection.role_name.


AnsibleRoleNamesRequired
public readonly AnsibleRoleNames: ListVariable;

The names of the roles currently imported into the current play, or roles referenced as dependencies of the roles imported into the current play.


AnsibleRunTagsRequired
public readonly AnsibleRunTags: ListVariable;

Contents of the --tags CLI option, which specifies which tags will be included for the current run.

Note that if --tags is not passed, this variable will default to ["all"].


AnsibleSearchPathRequired
public readonly AnsibleSearchPath: SimpleVariable;

Current search path for action plugins and lookups, in other words, where we search for relative paths when you do template: src=myfile.


AnsibleSkipTagsRequired
public readonly AnsibleSkipTags: ListVariable;

Contents of the --skip-tags CLI option, which specifies which tags will be skipped for the current run.


AnsibleUserRequired
public readonly AnsibleUser: SimpleVariable;

The user Ansible ‘logs in’ as.


AnsibleVerbosityRequired
public readonly AnsibleVerbosity: SimpleVariable;

Current verbosity setting for Ansible.


AnsibleVersionRequired
public readonly AnsibleVersion: SimpleVariable;

Dictionary/map that contains information about the current running version of ansible, it has the following keys: full, major, minor, revision and string.


GroupNamesRequired
public readonly GroupNames: ListVariable;

List of groups the current host is part of.


GroupsRequired
public readonly Groups: DictionaryVariable;

A dictionary/map with all the groups in inventory and each group has the list of hosts that belong to it.


HostVarsRequired
public readonly HostVars: DictionaryVariable;

A dictionary/map with all the hosts in inventory and variables assigned to them.


InventoryDirRequired
public readonly InventoryDir: SimpleVariable;

The directory of the inventory source in which the inventory_hostname was first defined.


InventoryFileRequired
public readonly InventoryFile: SimpleVariable;

The file name of the inventory source in which the inventory_hostname was first defined.


InventoryHostnameRequired
public readonly InventoryHostname: SimpleVariable;

The inventory name for the ‘current’ host being iterated over in the play.


InventoryHostnameShortRequired
public readonly InventoryHostnameShort: SimpleVariable;

The short version of inventory_hostname.


ItemRequired
public readonly Item: AnyVariable;

A special variable to quickly implement an item variable in a loop.


OmitRequired
public readonly Omit: SimpleVariable;

Special variable that allows you to ‘omit’ an option in a task, for example - user: name=bob home={{ bobs_home|default(omit) }}.


PlaybookDirRequired
public readonly PlaybookDir: SimpleVariable;

The path to the directory of the current playbook being executed.

NOTE: This might be different than directory of the playbook passed to the ansible-playbook command line when a playbook contains a import_playbook statement.


RoleNameRequired
public readonly RoleName: SimpleVariable;

The name of the role currently being executed.


RolePathRequired
public readonly RolePath: SimpleVariable;

The path to the dir of the currently running role.


PlayDefinition

Methods

Name Description
toJson Iterate over the chain, JSONify it, and return it as an array.
next No description.

toJson
public toJson(): any[]

Iterate over the chain, JSONify it, and return it as an array.

next
public next(next: IPlayChainable): PlayDefinition
nextRequired

Static Functions

Name Description
sequence No description.

sequence
import { PlayDefinition } from 'cdk-ans'

PlayDefinition.sequence(next: IPlayChainable, chain: Step[])
nextRequired

chainRequired

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

ProjectSynthesizer

Initializers

import { ProjectSynthesizer } from 'cdk-ans'

new ProjectSynthesizer(options?: ProjectSynthesizerOptions)
Name Type Description
options ProjectSynthesizerOptions No description.

optionsOptional

Methods

Name Description
synth No description.

synth
public synth(project: Project, outDir: string): void
projectRequired

outDirRequired
  • Type: string

Properties

Name Type Description
options ProjectSynthesizerOptions No description.

optionsRequired
public readonly options: ProjectSynthesizerOptions;

RoleDefinition

Methods

Name Description
toJson Iterate over the chain, JSONify it, and return it as an array.
next No description.

toJson
public toJson(): any[]

Iterate over the chain, JSONify it, and return it as an array.

next
public next(next: IRoleChainable): RoleDefinition
nextRequired

Static Functions

Name Description
sequence No description.

sequence
import { RoleDefinition } from 'cdk-ans'

RoleDefinition.sequence(next: IRoleChainable, chain: Step[])
nextRequired

chainRequired

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

RunDefinition

Initializers

import { RunDefinition } from 'cdk-ans'

new RunDefinition(chain: Step[])
Name Type Description
chain Step[] No description.

chainRequired

Methods

Name Description
toJson Iterate over the chain, JSONify it, and return it as an array.

toJson
public toJson(): any[]

Iterate over the chain, JSONify it, and return it as an array.

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

SimpleVariable

A variable that represents a flat value (string, number, boolean).

Initializers

import { SimpleVariable } from 'cdk-ans'

new SimpleVariable(name: string, parents?: string[])
Name Type Description
name string No description.
parents string[] No description.

nameRequired
  • Type: string

parentsOptional
  • Type: string[]

Methods

Name Description
asRaw Returns the variable as a raw string.
asVariable Returns the variable as an ansible variable string {{ variable }}.
index No description.
property No description.

asRaw
public asRaw(): string

Returns the variable as a raw string.

asVariable
public asVariable(): string

Returns the variable as an ansible variable string {{ variable }}.

index
public index(_: number): IVariable
_Required
  • Type: number

property
public property(_: string): IVariable
_Required
  • Type: string

Static Functions

Name Description
of No description.

of
import { SimpleVariable } from 'cdk-ans'

SimpleVariable.of(name: string)
nameRequired
  • Type: string

Properties

Name Type Description
name string No description.
parents string[] No description.

nameRequired
public readonly name: string;
  • Type: string

parentsRequired
public readonly parents: string[];
  • Type: string[]

TaskAction

Base class for all Task Actions.

Initializers

import { TaskAction } from 'cdk-ans'

new TaskAction(name: string, props: {[ key: string ]: any})
Name Type Description
name string No description.
props {[ key: string ]: any} No description.

nameRequired
  • Type: string

propsRequired
  • Type: {[ key: string ]: any}

Methods

Name Description
toJson No description.

toJson
public toJson(): any

Properties

Name Type Description
name string No description.
props {[ key: string ]: any} No description.

nameRequired
public readonly name: string;
  • Type: string

propsRequired
public readonly props: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

TaskDefinition

Methods

Name Description
toJson Iterate over the chain, JSONify it, and return it as an array.
next No description.

toJson
public toJson(): any[]

Iterate over the chain, JSONify it, and return it as an array.

next
public next(next: ITaskChainable): TaskDefinition
nextRequired

Static Functions

Name Description
sequence No description.

sequence
import { TaskDefinition } from 'cdk-ans'

TaskDefinition.sequence(next: ITaskChainable, chain: Step[])
nextRequired

chainRequired

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

Yaml

YAML utilities.

Static Functions

Name Description
load Downloads a set of YAML documents from a file and returns them as javascript objects.
save Saves a set of objects as a multi-document YAML file.
stringify Stringify a document (or multiple documents) into YAML.

load
import { Yaml } from 'cdk-ans'

Yaml.load(file: string)

Downloads a set of YAML documents from a file and returns them as javascript objects.

Empty documents are filtered out.

fileRequired
  • Type: string

path to load from.


save
import { Yaml } from 'cdk-ans'

Yaml.save(filePath: string, docs: any[])

Saves a set of objects as a multi-document YAML file.

filePathRequired
  • Type: string

The output path.


docsRequired
  • Type: any[]

The set of objects.


stringify
import { Yaml } from 'cdk-ans'

Yaml.stringify(docs: any)

Stringify a document (or multiple documents) into YAML.

We convert undefined values to null, but ignore any documents that are undefined.

docsRequired
  • Type: any

A set of objects to convert to YAML.


Protocols

IChainable

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

IHostIdentifiable

Properties

Name Type Description
identifier string No description.

identifierRequired
public readonly identifier: string;
  • Type: string

IPlayChainable

Methods

Name Description
next No description.

next
public next(next: IPlayChainable): PlayDefinition
nextRequired

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

IRoleChainable

Methods

Name Description
next No description.

next
public next(next: IRoleChainable): RoleDefinition
nextRequired

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

ISynthesizer

Methods

Name Description
synth No description.

synth
public synth(project: Project, outDir: string): void
projectRequired

outDirRequired
  • Type: string

ITaskChainable

Methods

Name Description
next No description.

next
public next(next: ITaskChainable): TaskDefinition
nextRequired

Properties

Name Type Description
chain Step[] No description.

chainRequired
public readonly chain: Step[];

IVariable

A variable that can access any type of variable.

Methods

Name Description
asRaw Returns the variable as a raw string.
asVariable Returns the variable as an ansible variable string {{ variable }}.
index No description.
property No description.

asRaw
public asRaw(): string

Returns the variable as a raw string.

asVariable
public asVariable(): string

Returns the variable as an ansible variable string {{ variable }}.

index
public index(index: number): IVariable
indexRequired
  • Type: number

property
public property(name: string): IVariable
nameRequired
  • Type: string

Enums

AnsibleConnection

The connection type to use to connect to the host.

https://docs.ansible.com/ansible/latest/user_guide/connection_details.html#connection-types

Members

Name Description
SMART No description.
SSH No description.
PARAMIKO No description.
LOCAL No description.

SMART

SSH

PARAMIKO

LOCAL

ConditionalEvaluation

Members

Name Description
AND No description.
OR No description.
IS No description.
IS_NOT No description.
IN No description.
NOT_IN No description.
WHEN_EQUALS No description.
WHEN_NOT_EQUALS No description.
WHEN_GREATER_THAN No description.
WHEN_LESS_THAN No description.
WHEN_GREATER_THAN_OR_EQUALS No description.
WHEN_LESS_THAN_OR_EQUALS No description.
BOOL No description.
BOOL_NOT No description.
DEFINED No description.
UNDEFINED No description.
FAILED No description.
SUCCEEDED No description.
SKIPPED No description.
CHANGED No description.

AND

OR

IS

IS_NOT

IN

NOT_IN

WHEN_EQUALS

WHEN_NOT_EQUALS

WHEN_GREATER_THAN

WHEN_LESS_THAN

WHEN_GREATER_THAN_OR_EQUALS

WHEN_LESS_THAN_OR_EQUALS

BOOL

BOOL_NOT

DEFINED

UNDEFINED

FAILED

SUCCEEDED

SKIPPED

CHANGED

InventoryOutputType

How inventories should be sythesized in the output directory.

Members

Name Description
SINGLE_FILE Create a single inventory file including all hosts, hosts vars, and groups in one.
GROUP_AND_HOST_VAR_FILES Create a file for hosts, a file for each host's vars, and a file for each group's vars.

SINGLE_FILE

Create a single inventory file including all hosts, hosts vars, and groups in one.


GROUP_AND_HOST_VAR_FILES

Create a file for hosts, a file for each host's vars, and a file for each group's vars.


IsEvaluation

Members

Name Description
DEFINED No description.
UNDEFINED No description.
FAILED No description.
SUCCEEDED No description.
SKIPPED No description.
CHANGED No description.

DEFINED

UNDEFINED

FAILED

SUCCEEDED

SKIPPED

CHANGED

PlaybookOutputType

How playbooks should be sythesized in the output directory.

Members

Name Description
IN_ROOT Place all playbooks in the root of the project.
IN_DIRECTORY Place all playbooks in a directory named "playbooks".

IN_ROOT

Place all playbooks in the root of the project.


IN_DIRECTORY

Place all playbooks in a directory named "playbooks".


PlayHostOrder

Members

Name Description
INVENTORY No description.
SORTED No description.
REVERSE_SORTED No description.
REVERSE_INVENTORY No description.
SHUFFLED No description.

INVENTORY

SORTED

REVERSE_SORTED

REVERSE_INVENTORY

SHUFFLED

RoleOutputType

How roles should be sythesized in the output directory.

Members

Name Description
STANDARD Use the standard role structure https://docs.ansible.com/ansible/2.8/user_guide/playbooks_reuse_roles.html#role-directory-structure.

STANDARD

Use the standard role structure https://docs.ansible.com/ansible/2.8/user_guide/playbooks_reuse_roles.html#role-directory-structure.