-
Notifications
You must be signed in to change notification settings - Fork 10
Templating Library
Laforge Uses GoLang's Laforge Has some custom Template Variables and Functions available to be used in creating scripts in addition to what you can normally do with the library.
Parameter: s String
It is a template function that renders a safe HCLv2 string from s
Parameter: n Integer
N returns a slice of n 0-sized elements, suitable for ranging over.
Parameter: s String
UnsafeAtoi will convert the string s to an integer and return -1 if it cannot convert the string to an integer.
Parameter: n Integer
Decreases n by 1 non-destructively and returns the result
Parameter: s String
Converts s to an all Upper Case string
Parameter: s String, substring String
Returns True or False if substring is in s
Parameter: s String, prefix String
Returns True or False if s has the defined prefix
Parameter: s String, suffix String
Returns True or False if s has the defined suffix
Parameter: elems
Takes elems which is an array of strings and combines it into 1 string with the elements separated with sep
Parameter: s string, old_string string, new_string string, n int
Replaces instances of old_string in s with new_string n number of times.
If n is < 0 then all occurrences will be replaced
Parameter: s string, n int
Returns a string with s repeated n times
Parameter: s string, sep string
Returns an array of strings from s with the elements separated by sep
Parameter: s String
Converts s to a Title cased string
Parameter: s String
Converts s to an all Lower Case string
Parameter: s String
Converts s to Snake cased string
Parameter: s String
Converts s to an all Upper Case Snake cased string
Parameter: s String
Converts s to a Kebab cased string
Parameter: s String
Converts s to an all Upper Case Kebab cased string
Parameter: s string, delimiter uint8
Converts s to a string delimited by delimiter
Parameter: s string, delimiter uint8, ignore uint8, screaming bool
Converts s to a string delimited by delimiter that does not modify the ignore character and is converted to all uppercase if screaming is true
Parameter: s String
Converts s to a Camel cased string
Parameter: s String
Converts s to a Lower Case, Camel cased string
Parameter: n Integer
Increases n by 1 non-destructively and returns the result
Parameter: subnet string, lastOctect int
Returns the IP of a subnet plus the lastOctect as a string
Parameter: h
Takes a host object h and returns True or False if it contains the tag tag and if the value of that tag is value
Parameter: n
Returns the Last Octect of the CIDR defined for the n network
Parameter: path string
Returns the Base of the specified path
revision
- Type: Int
- Description: The version number of this Build for the Environment
environment_revision
- Type: Int
- Description: The Environment Revision this build is built off of
hcl_id
- Type: String
- Description: The HCL ID of the Competition Object in the LaForge Config
root_password
- Type: String
- Description: The Default Password for Boxes in the Competition
config
- Type: map[string]string
- Description: A map of configuration Key-Value Pairs
- Optional
tags
- Type: map[string]string
- Description: A map of tag Key-Value Pairs
- Optional
hcl_id
- Type: String
- Description: The HCL ID of the Enviroment Object in the LaForge Config
competition_id
- Type: String
- Description: The HCL ID of the Competition Object for this Enviroment
name
- Type: String
- Description: The Name of the Enviroment
description
- Type: String
- Description: The Description of the Enviroment
builder
- Type: String
- Description: The Builder that will be Used for this Enviroment
team_count
- Type: Int
- Description: The amount of teams to build this envrioment
revision
- Type: Int
- Description: The version number of this Enviroment. Basically the amount of times this enviroment was loaded.
admin_cidrs
- Type: []string
- Description: The CIDRs that have full port access to VDI Boxes
exposed_vdi_ports
- Type: []string
- Description: The ports that are accessable by everyone for the VDI Boxes
config
- Type: map[string]string
- Description: A map of configuration Key-Value Pairs
- Optional
tags
- Type: map[string]string
- Description: A map of tag Key-Value Pairs
- Optional
hcl_id
- Type: String
- Description: The HCL ID of the DNS Object in the LaForge Config
type
- Type: String
- Description: The type of DNS server, EX: "bind"
root_domain
- Type: String
- Description: The root domain of the DNS server
dns_servers
- Type: []string
- Description: A List of DNS Servers for this DNS Object
ntp_servers
- Type: []string
- Description: A List of NTP Servers for this DNS Object
- Optional
config
- Type: map[string]string
- Description: A map of configuration Key-Value Pairs
- Optional
hcl_id
- Type: String
- Description: The HCL ID of the DNSRecords Object in the LaForge Config
name
- Type: String
- Description:
values
- Type: []string
- Description:
- Optional
type
- Type: string
- Description:
zone
- Type: string
- Description:
vars
- Type: map[string]string
- Description: A map of vars Key-Value Pairs
- Optional
disabled
- Type: bool
- Description:
tags
- Type: map[string]string
- Description: A Tag of configuration Key-Value Pairs
- Optional
hcl_id
- Type: String
- Description: The HCL ID of the Enviroment Object in the LaForge Config
hostname
- Type: String
- Description: The first part if the Hostname for this host
description
- Type: String
- Description: The Description of the Host
- Optional
OS
- Type: String
- Description: The OS of the Host
last_octet
- Type: Int
- Description: The last octet of the host in the network it's apart of
instance_size
- Type: String
- Description: The size of the Host
allow_mac_changes
- Type: Bool
- Description: Needed for VM Stuff
- Optional
exposed_tcp_ports
- Type: []string
- Description: The TCP Ports that the Host will expose
- Optional
exposed_udp_ports
- Type: []string
- Description: The UDP Port that the Host will expose
- Optional
override_password
- Type: String
- Description: The Defult Password for the Host if set
- Optional
vars
- Type: map[string]string
- Description: A map of vars Key-Value Pairs
- Optional
user_groups
- Type: []string
- Description: A list of user groups for the host
- Optional
provision_steps
- Type: []string
- Description: A list of Provision Steps using their HCL IDs
- Optional
tags
- Type: map[string]string
- Description: A Tag of configuration Key-Value Pairs
- Optional
name
- Type: String
- Description: Network HCL ID
hosts
- Type: []String
- Description: List of Host HCL IDs
Edges.IncludedNetworkToHost
- Type: Host
- Description: See Above
Edges.IncludedNetworkToNetwork
- Type: Network
- Description: See Below
hcl_id
- Type: String
- Description: The HCL ID of the Network Object in the LaForge Config
name
- Type: String
- Description: Network Name
cidr
- Type: String
- Description: Network Name
vdi_visible
- Type: bool
- Description: If the network is visable for the VDI
- Optional
vars
- Type: map[string]string
- Description: A map of vars Key-Value Pairs
- Optional
tags
- Type: map[string]string
- Description: A Tag of configuration Key-Value Pairs
- Optional
hcl_id
- Type: String
- Description: The HCL ID of the Script Object in the LaForge Config
name
- Type: String
- Description: Script Name
language
- Type: String
- Description: either something like
shellorpowershell
description
- Type: String
- Description: Description of the script
- Optional
source_type
- Type: string
- Description: Should be
localprobably
source
- Type: string
- Description: Path to the
scriptin the repo according to where this config file is
cooldown
- Type: Int
- Description:
- Optional
timeout
- Type: Int
- Description:
- Optional
ignore_errors
- Type: bool
- Description:
- Optional
args
- Type: []string
- Description: Args for script
- Optional
disabled
- Type: bool
- Description:
- Optional
vars
- Type: map[string]string
- Description: A map of vars Key-Value Pairs
- Optional
abs_path
- Type: string
- Description: Absolute path for script on the build box
- Optional
tags
- Type: map[string]string
- Description: A Tag of configuration Key-Value Pairs
- Optional
cooldown
- Type: Int
- Description: Team Number
vars
- Type: map[string]string
- Description: A map of vars Key-Value Pairs
-
gateway_public_ipis the key to get the public IP for the team, if it exists
hcl_id
- Type: String
- Description: The HCL ID of the Identity Object in the LaForge Config
first_name
- Type: String
- Description:
last_name
- Type: String
- Description:
email
- Type: String
- Description:
password
- Type: String
- Description:
description
- Type: String
- Description:
- Optional
avatar_file
- Type: String
- Description:
- Optional
vars
- Type: map[string]string
- Description: A map of vars Key-Value Pairs
- Optional
tags
- Type: map[string]string
- Description: A Tag of configuration Key-Value Pairs
- Optional
name
- Type: String
- Description: Provisioned Network Name
cidr
- Type: String
- Description: Provisioned Network Name
subnet_ip
- Type: String
- Description: IP of the Deployed Host
addon_type
- Type: Enum
- Values: DNS
type
- Type: Enum
- Values:
ScriptCommandDNSRecordFileDeleteFileDownloadFileExtract
step_number
- Type: Int
- Description: The order in which the ProvisioningStep is sent
- Type: String
- Description: The Slug to get the Agent