Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
ab523cea
Commit
ab523cea
authored
Jun 22, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using YAML syntax for ansible tasks
parent
92acf889
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
playbooks/roles/git_clone/tasks/main.yml
+17
-13
No files found.
playbooks/roles/git_clone/tasks/main.yml
View file @
ab523cea
...
...
@@ -17,7 +17,10 @@
# require in our default configuration.
#
#
-
name
:
set git fetch.prune to ignore deleted remote refs
# Rewrite this task using the ansible git-config module once we'll migrate to Ansible 2.x
# https://docs.ansible.com/ansible/git_config_module.html#git-config
#
-
name
:
Set git fetch.prune to ignore deleted remote refs
shell
:
git config --global fetch.prune
true
become_user
:
"
{{
repo_owner
}}"
when
:
GIT_REPOS is defined
...
...
@@ -25,28 +28,29 @@
-
install
-
install:code
-
name
:
validate git protocol
fail
:
msg='GIT_REPOS.PROTOCOL must be "https" or "ssh"'
-
name
:
Validate git protocol
fail
:
msg
:
'
{{
GIT_REPOS.PROTOCOL
}}
must
be
"https"
or
"ssh"'
when
:
(item.PROTOCOL != "https") and (item.PROTOCOL != "ssh") and GIT_REPOS is defined
with_items
:
GIT_REPOS
with_items
:
"
{{
GIT_REPOS
}}"
tags
:
-
install
-
install:code
-
name
:
i
nstall read-only ssh key
-
name
:
I
nstall read-only ssh key
copy
:
dest
:
"
{{
git_home
}}/.ssh/{{
item.REPO
}}"
content
:
"
{{
item.SSH_KEY
}}"
owner
:
"
{{
repo_owner
}}"
group
:
"
{{
repo_group
}}"
mode
:
0600
mode
:
"
0600"
when
:
item.PROTOCOL == "ssh" and GIT_REPOS is defined
with_items
:
GIT_REPOS
with_items
:
"
{{
GIT_REPOS
}}"
tags
:
-
install
-
install:code
-
name
:
c
heckout code over ssh
-
name
:
C
heckout code over ssh
git_2_0_1
:
repo
:
"
git@{{
item.DOMAIN
}}:{{
item.PATH
}}/{{
item.REPO
}}"
dest
:
"
{{
item.DESTINATION
}}"
...
...
@@ -56,12 +60,12 @@
become_user
:
"
{{
repo_owner
}}"
register
:
code_checkout
when
:
item.PROTOCOL == "ssh" and GIT_REPOS is defined
with_items
:
GIT_REPOS
with_items
:
"
{{
GIT_REPOS
}}"
tags
:
-
install
-
install:code
-
name
:
c
heckout code over https
-
name
:
C
heckout code over https
git_2_0_1
:
repo
:
"
https://{{
item.DOMAIN
}}/{{
item.PATH
}}/{{
item.REPO
}}"
dest
:
"
{{
item.DESTINATION
}}"
...
...
@@ -69,17 +73,17 @@
become_user
:
"
{{
repo_owner
}}"
register
:
code_checkout
when
:
item.PROTOCOL == "https" and GIT_REPOS is defined
with_items
:
GIT_REPOS
with_items
:
"
{{
GIT_REPOS
}}"
tags
:
-
install
-
install:code
-
name
:
r
emove read-only ssh key
-
name
:
R
emove read-only ssh key
file
:
dest
:
"
{{
git_home
}}/.ssh/{{
item.REPO
}}"
state
:
absent
when
:
item.PROTOCOL == "ssh" and GIT_REPOS is defined
with_items
:
GIT_REPOS
with_items
:
"
{{
GIT_REPOS
}}"
tags
:
-
install
-
install:code
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment