Ansible: git

Download (copy) several repos

- name: IM config | download submodules repos
  ansible.builtin.git:
    repo: 'http://{{gituser}}:{{gitpass}}@gitlab.ru.mgo.su/dit-bitrix/{{ item }}.git'
    dest: '/home/bitrix/web/mango-office.ru/public_html/{{release_dir}}/local/modules/{{ item }}'
    version: release_ru
    recursive: no
    force: yes
  with_items:
    - 'mango_lk'
    - 'mango_dev_tools'
    - 'mango.billing'
    - 'mango_calltracking'
    - 'mango_constructor'
    - 'mango_push'
    - 'mango_statistic'
    - 'mango_segments'

Actually these repos were defined as submodules and could be downloaded with recursive: yes flag but in my case user should be definded because submodules are downded through ssh

- name: IM config | download bitrix_rt repo
  ansible.builtin.git:
    repo: 'git@gitlab.ru.mgo.su:dit-bitrix/mo_core.git'
    dest: '/home/bitrix/web/mango-office.ru/public_html/{{release_dir}}'
    version: release
    recursive: yes
    force: yes
  become: true
  become_user: '{{ ansible_user }}'

Last updated

Was this helpful?