kerry-0.1: Manage and abstract your packer configurations.

Safe HaskellNone
LanguageHaskell2010

Kerry.Provisioner.Shell

Contents

Synopsis

Shell provisioner

data Shell Source #

The shell Packer provisioner provisions machines built by Packer using shell scripts. Shell provisioning is the easiest way to get software installed and configured on a machine.

Constructors

Shell 

Fields

  • shellType :: ShellType
     
  • shellBinary :: Maybe Bool

    If true, specifies that the script(s) are binary files, and Packer should therefore not convert Windows line endings to Unix line endings (if there are any). By default this is false.

  • shellValidExitCodes :: Maybe [Int]

    Valid exit codes for the script. By default this is just 0.

  • shellEnvironmentVars :: Maybe [Text]

    An array of key/value pairs to inject prior to the execute_command. The format should be key=value. Packer injects some environmental variables by default into the environment, as well, which are covered in the section below.

  • shellUseEnvVarFile :: Maybe Bool

    If true, Packer will write your environment variables to a tempfile and source them from that file, rather than declaring them inline in our execute_command. The default execute_command will be chmod +x {{.Path}}; . {{.EnvVarFile}} && {{.Path}}. This option is unnecessary for most cases, but if you have extra quoting in your custom execute_command, then this may be unnecessary for proper script execution. Default: false.

  • shellExecuteCommand :: Maybe Text

    The command to use to execute the script. By default this is chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}, unless the user has set "use_env_var_file": true -- in that case, the default execute_command is chmod +x {{.Path}}; . {{.EnvVarFile}} && {{.Path}}. The value of this is treated as a configuration template. There are three available variables:

    Path is the path to the script to run Vars is the list of environment_vars, if configured. EnvVarFile is the path to the file containing env vars, if use_env_var_file is true.

  • shellExpectDisconnect :: Maybe Bool

    Defaults to false. Whether to error if the server disconnects us. A disconnect might happen if you restart the ssh server or reboot the host.

  • shellInlineShebang :: Maybe Text

    The shebang value to use when running commands specified by inline. By default, this is binsh -e. If you're not using inline, then this configuration has no effect. Important: If you customize this, be sure to include something like the -e flag, otherwise individual steps failing won't fail the provisioner.

  • shellRemoteFolder :: Maybe FilePath

    The folder where the uploaded script will reside on the machine. This defaults to '/tmp'.

  • shellRemoteFile :: Maybe Text

    The filename the uploaded script will have on the machine. This defaults to 'script_nnn.sh'.

  • shellRemotePath :: Maybe FilePath

    The full path to the uploaded script will have on the machine. By default this is remote_folder/remote_file, if set this option will override both remote_folder and remote_file.

  • shellSkipClean :: Maybe Bool

    If true, specifies that the helper scripts uploaded to the system will not be removed by Packer. This defaults to false (clean scripts from the system).

  • shellStartRetryTimeout :: Maybe Text

    The amount of time to attempt to start the remote process. By default this is 5m or 5 minutes. This setting exists in order to deal with times when SSH may restart, such as a system reboot. Set this to a higher value if reboots take a longer amount of time.

  • shellPauseAfter :: Maybe Text

    Wait the amount of time after provisioning a shell script, this pause be taken if all previous steps were successful.

Instances
Eq Shell Source # 
Instance details

Defined in Kerry.Provisioner.Shell

Methods

(==) :: Shell -> Shell -> Bool #

(/=) :: Shell -> Shell -> Bool #

Show Shell Source # 
Instance details

Defined in Kerry.Provisioner.Shell

Methods

showsPrec :: Int -> Shell -> ShowS #

show :: Shell -> String #

showList :: [Shell] -> ShowS #

data ShellType Source #

Constructors

Inline [Text] 
Script Text 
Scripts [Text] 
Instances
Eq ShellType Source # 
Instance details

Defined in Kerry.Provisioner.Shell

Show ShellType Source # 
Instance details

Defined in Kerry.Provisioner.Shell

Serialziation

fromShell :: Shell -> [Pair] Source #

Shell serialization