github.com/marksheahan/packer@v0.10.2-0.20160613200515-1acb2d6645a0/website/source/docs/templates/communicator.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Templates: Communicators"
     4  description: |-
     5    Communicators are the mechanism Packer uses to upload files, execute scripts, etc. with the machine being created.
     6  ---
     7  
     8  # Templates: Communicators
     9  
    10  Communicators are the mechanism Packer uses to upload files, execute
    11  scripts, etc. with the machine being created.
    12  
    13  Communicators are configured within the [builder](/docs/templates/builders.html)
    14  section. Packer currently supports three kinds of communicators:
    15  
    16    * `none` - No communicator will be used. If this is set, most provisioners
    17        also can't be used.
    18  
    19    * `ssh` - An SSH connection will be established to the machine. This is
    20        usually the default.
    21  
    22    * `winrm` - A WinRM connection will be established.
    23  
    24  In addition to the above, some builders have custom communicators they can
    25  use. For example, the Docker builder has a "docker" communicator that uses
    26  `docker exec` and `docker cp` to execute scripts and copy files.
    27  
    28  ## Using a Communicator
    29  
    30  By default, the SSH communicator is usually used. Additional configuration
    31  may not even be necessary, since some builders such as Amazon automatically
    32  configure everything.
    33  
    34  However, to specify a communicator, you set the `communicator` key within
    35  a build. Multiple builds can have different communicators. Example:
    36  
    37  ```javascript
    38  {
    39      "builders": [{
    40          "type": "amazon-ebs",
    41          "communicator": "ssh"
    42      }]
    43  }
    44  ```
    45  
    46  After specifying the `communicator`, you can specify a number of other
    47  configuration parameters for that communicator. These are documented below.
    48  
    49  ## SSH Communicator
    50  
    51  The SSH communicator connects to the host via SSH. If you have an SSH
    52  agent enabled on the machine running Packer, it will automatically forward
    53  the SSH agent to the remote host.
    54  
    55  The SSH communicator has the following options:
    56  
    57    * `ssh_bastion_host` (string) - A bastion host to use for the actual
    58      SSH connection.
    59  
    60    * `ssh_bastion_password` (string) - The password to use to authenticate
    61      with the bastion host.
    62  
    63    * `ssh_bastion_port` (integer) - The port of the bastion host. Defaults to
    64      22.
    65  
    66    * `ssh_bastion_private_key_file` (string) - A private key file to use
    67      to authenticate with the bastion host.
    68  
    69    * `ssh_bastion_username` (string) - The username to connect to the bastion
    70      host.
    71  
    72    * `ssh_disable_agent` (boolean) - If true, SSH agent forwarding will be
    73      disabled.
    74  
    75    * `ssh_file_transfer_method` (`scp` or `sftp`) - How to transfer files, Secure
    76      copy (default) or SSH File Transfer Protocol.
    77  
    78    * `ssh_handshake_attempts` (integer) - The number of handshakes to attempt
    79      with SSH once it can connect. This defaults to 10.
    80  
    81    * `ssh_host` (string) - The address to SSH to. This usually is automatically
    82      configured by the builder.
    83  
    84    * `ssh_password` (string) - A plaintext password to use to authenticate
    85      with SSH.
    86  
    87    * `ssh_port` (integer) - The port to connect to SSH. This defaults to 22.
    88  
    89    * `ssh_private_key_file` (string) - Path to a PEM encoded private key
    90      file to use to authentiate with SSH.
    91  
    92    * `ssh_pty` (boolean) - If true, a PTY will be requested for the SSH
    93      connection. This defaults to false.
    94  
    95    * `ssh_timeout` (string) - The time to wait for SSH to become available.
    96      Packer uses this to determine when the machine has booted so this is
    97      usually quite long. Example value: "10m"
    98  
    99    * `ssh_username` (string) - The username to connect to SSH with.
   100  
   101  ## WinRM Communicator
   102  
   103  The WinRM communicator has the following options.
   104  
   105    * `winrm_host` (string) - The address for WinRM to connect to.
   106  
   107    * `winrm_port` (integer) - The WinRM port to connect to. This defaults to
   108      5985 for plain unencrypted connection and 5986 for SSL when `winrm_use_ssl` is set to true.
   109  
   110    * `winrm_username` (string) - The username to use to connect to WinRM.
   111  
   112    * `winrm_password` (string) - The password to use to connect to WinRM.
   113  
   114    * `winrm_timeout` (string) - The amount of time to wait for WinRM to
   115      become available. This defaults to "30m" since setting up a Windows
   116      machine generally takes a long time.
   117  
   118    * `winrm_use_ssl` (boolean) - If true, use HTTPS for WinRM
   119  
   120    * `winrm_insecure` (boolean) - If true, do not check server certificate
   121      chain and host name