Skip to content

Commit 0625176

Browse files
author
Pierre Buyle
committed
Add option to force checkout of the git repository.
1 parent c730819 commit 0625176

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ The following variables are available to configure the role:
2323
- **nginx_drupal_git**
2424
- **repo**: The URL of the Git repository to checkout the base
2525
configuration from, defaults to https://github.com/perusio/drupal-with-nginx.git
26-
- **version** The version of the version of the repository to
26+
- **version**: The version of the version of the repository to
2727
check out. This can be the full 40-character SHA-1 hash, the literal string
2828
HEAD, a branch name, or a tag name. Defaults to 'D7'.
29+
- **force_checkout**: True to always do a git checkout. Defaults to False.
2930
- **nginx_drupal_config_path**: The path to Nginx configuration folder,
3031
defaults to "/etc/nginx".
3132
- **nginx_drupal_log_path**: The path to Nginx log files, defaults to

tasks/git-checkout.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
register: nginx_drupal_config_path_dot_git
55
- name: "Remove existing configurarion directory"
66
file: path={{nginx_drupal_config_path}} state=absent
7-
when: nginx_drupal_config_path_dot_git.stat.exists == false
7+
when: not nginx_drupal_config_path_dot_git.stat.exists
88
- name: "Checkout configuration directory"
9-
git: dest={{nginx_drupal_config_path}} repo={{nginx_drupal_git.repo}} version={{nginx_drupal_git.version}} force=no
9+
git: dest={{nginx_drupal_config_path}} repo={{nginx_drupal_git.repo}} version={{nginx_drupal_git.version}} force=yes
10+
when: (not nginx_drupal_config_path_dot_git.stat.exists) or (nginx_drupal_git.force_checkout|default(False))
1011
notify:
1112
- reload nginx
1213
- name: "Remove example.com configuration file"

0 commit comments

Comments
 (0)