github.com/kaixiang/packer@v0.5.2-0.20140114230416-1f5786b0d7f1/website/source/docs/provisioners/ansible-local.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Ansible (Local) Provisioner"
     4  ---
     5  
     6  # Ansible Local Provisioner
     7  
     8  Type: `ansible-local`
     9  
    10  The `ansible-local` provisioner configures Ansible to run on the machine by
    11  Packer from local Playbook and Role files.  Playbooks and Roles can be uploaded
    12  from your local machine to the remote machine.  Ansible is run in [local mode](http://www.ansibleworks.com/docs/playbooks2.html#local-playbooks) via the `ansible-playbook` command.
    13  
    14  ## Basic Example
    15  
    16  The example below is fully functional.
    17  
    18  <pre class="prettyprint">
    19  {
    20      "type": "ansible-local",
    21      "playbook_file": "local.yml"
    22  }
    23  </pre>
    24  
    25  ## Configuration Reference
    26  
    27  The reference of available configuration options is listed below.
    28  
    29  Required:
    30  
    31  * `playbook_file` (string) - The playbook file to be executed by ansible.
    32    This file must exist on your local system and will be uploaded to the
    33    remote machine.
    34  
    35  Optional:
    36  
    37  * `playbook_paths` (array of strings) - An array of paths to playbook files on
    38    your local system. These will be uploaded to the remote machine under
    39    `staging_directory`/playbooks. By default, this is empty.
    40  
    41  * `role_paths` (array of strings) - An array of paths to role directories on
    42    your local system. These will be uploaded to the remote machine under
    43    `staging_directory`/roles. By default, this is empty.
    44  
    45  * `staging_directory` (string) - The directory where all the configuration of
    46    Ansible by Packer will be placed. By default this is "/tmp/packer-provisioner-ansible-local".
    47    This directory doesn't need to exist but must have proper permissions so that
    48    the SSH user that Packer uses is able to create directories and write into
    49    this folder. If the permissions are not correct, use a shell provisioner prior
    50    to this to configure it properly.