Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
All strings within templates are processed by a common Packer templating engine, where variables and functions can be used to modify the value of a configuration parameter at runtime.
Synopsis
- newtype Template = Template {}
- data RawTemplate
- toTemplate :: RawTemplate -> Template
- renderRawTemplate :: RawTemplate -> Text
- user :: Text -> RawTemplate
- templateVariable :: Text -> Template
- buildName :: RawTemplate
- buildType :: RawTemplate
- env :: Text -> RawTemplate
- isotime :: Text -> RawTemplate
- lower :: RawTemplate
- pwd :: RawTemplate
- sed :: Text -> Text -> RawTemplate
- split :: Text -> Text -> Int -> RawTemplate
- templateDir :: RawTemplate
- timestamp :: RawTemplate
- uuid :: RawTemplate
- upper :: RawTemplate
- packerVersion :: RawTemplate
- cleanResourceName :: RawTemplate
Documentation
data RawTemplate Source #
Instances
Eq RawTemplate Source # | |
Defined in Kerry.Engine (==) :: RawTemplate -> RawTemplate -> Bool # (/=) :: RawTemplate -> RawTemplate -> Bool # | |
Show RawTemplate Source # | |
Defined in Kerry.Engine showsPrec :: Int -> RawTemplate -> ShowS # show :: RawTemplate -> String # showList :: [RawTemplate] -> ShowS # |
toTemplate :: RawTemplate -> Template Source #
renderRawTemplate :: RawTemplate -> Text Source #
User Variable
user :: Text -> RawTemplate Source #
User variables
Template Variable
templateVariable :: Text -> Template Source #
Template variables are special variables automatically set by Packer at build time. Some builders, provisioners and other components have template variables that are available only for that component. Template variables are recognizable because they're prefixed by a period, such as {{ .Name }}.
Functions
buildName :: RawTemplate Source #
The name of the build being run.
buildType :: RawTemplate Source #
The type of the builder being used currently.
env :: Text -> RawTemplate Source #
Returns environment variables. See example in using home variable
isotime :: Text -> RawTemplate Source #
UTC time, which can be formatted. See more examples below in the isotime format reference.
lower :: RawTemplate Source #
Lowercases the string.
pwd :: RawTemplate Source #
The working directory while executing Packer.
sed :: Text -> Text -> RawTemplate Source #
Use a golang implementation of sed to parse an input string.
split :: Text -> Text -> Int -> RawTemplate Source #
Split an input string using separator and return the requested substring.
templateDir :: RawTemplate Source #
The directory to the template for the build.
timestamp :: RawTemplate Source #
The current Unix timestamp in UTC.
uuid :: RawTemplate Source #
Returns a random UUID.
upper :: RawTemplate Source #
Uppercases the string.
packerVersion :: RawTemplate Source #
Returns Packer version.
cleanResourceName :: RawTemplate Source #
Image names can only contain certain characters and have a maximum length, eg 63 on GCE & 80 on Azure. clean_resource_name will convert upper cases to lower cases and replace illegal characters with a "-" character.