- name: copy git key
  copy: "src=files/ssh/git/git_key dest=/tmp/{{username}}_git_key mode=600"
  tags:
    - orchard-ows-search-git

- name: create orchard folder
  file: dest="{{ orchard_ows_search_document_root }}" owner="{{ server_files_user }}" group="{{ server_files_group }}" mode=775 state=directory
  when: inventory_hostname == "dev_client"
  become: true
  tags:
    - orchard-ows-search-git

- name: git pull
  git: repo={{ orchard.git.ows_search.repo }}
       dest={{ orchard.git.ows_search.folder_path }}
       version={{ orchard.git.ows_search.branch_name }}
       accept_hostkey=no
       force=yes
       update=yes
       key_file=/tmp/{{username}}_git_key
  tags:
    - orchard-ows-search-git
- name: remove git key
  file: path=/tmp/{{username}}_git_key
        state=absent
  tags:
    - orchard-ows-search-git
