forked from theforeman/forklift
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremote.yml
More file actions
26 lines (25 loc) · 975 Bytes
/
remote.yml
File metadata and controls
26 lines (25 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
- name: "Configure additional remote for repository"
block:
- name: "Configure remote url"
community.general.git_config:
scope: local
repo: "{{ git_repo_repository.dir }}/{{ git_repo_repository.name }}"
name: "remote.{{ remote.name }}.url"
value: "{{ remote.url }}"
- name: "Configure remote fetch"
community.general.git_config:
scope: local
repo: "{{ git_repo_repository.dir }}/{{ git_repo_repository.name }}"
name: "remote.{{ remote.name }}.fetch"
value: '+refs/heads/*:refs/remotes/{{ remote.name }}/*'
- name: "Fetch remote"
ansible.builtin.command:
cmd: "git fetch {{ remote.name }}"
chdir: "{{ git_repo_repository.dir }}/{{ git_repo_repository.name }}"
- name: "Configure branches for additional remote"
ansible.builtin.include_tasks: branch.yml
when: remote.branches is defined
loop: "{{ remote.branches }}"
loop_control:
loop_var: branch