Skip to content

Instantly share code, notes, and snippets.

@thunder-spb
Forked from mblarsen/deploy.yaml
Created February 2, 2016 15:58
Show Gist options
  • Save thunder-spb/ca2bde6990198f73b95f to your computer and use it in GitHub Desktop.
Save thunder-spb/ca2bde6990198f73b95f to your computer and use it in GitHub Desktop.

Revisions

  1. @mblarsen mblarsen renamed this gist Aug 14, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @mblarsen mblarsen created this gist Aug 14, 2014.
    30 changes: 30 additions & 0 deletions gistfile1.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # Problem:
    #
    # If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
    # Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
    # This means your ansible playbook will hang in this case.
    #
    # You can however use the ansible git module to checkout your repo in multiple steps, like this:
    #
    - hosts: webserver
    vars:
    - destination: /your/dest/path
    tasks:
    - name: App | Cloning repos + submodules
    git: [email protected]:Organisation/{{ item.repo }}.git
    dest={{ item.dest }}
    accept_hostkey=yes
    force=yes
    recursive=no
    key_file=/home/user/.ssh/id_rsa.github-{{ item.repo }}
    with_items:
    -
    dest: "{{ destination }}"
    repo: PrimaryRepo
    -
    dest: "{{ destination }}/app/core"
    repo: SubmoduleRepo

    #
    # The key part is that `recursive` is set to `no`.
    #