Skip to content

Commit

Permalink
Allow custom git user email for each playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamanzo authored and Rafael Reggiani Manzo committed Sep 25, 2017
1 parent 0fb72c0 commit 7bd5f3d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The version numbers try to follow the standards set by http://semver.org

## Unreleased

* Allow custom git user email for each playbook
* Create Mandaê tasks file
* Create gaming role
* Create EVA playbook
Expand Down
3 changes: 3 additions & 0 deletions eva.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
notebook:
ps_ac_string: 'ACAD'
ps_bt_string: 'BAT1'
git:
name: 'Rafael Reggiani Manzo'
email: '[email protected]'
environment:
PATH: "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"
roles:
Expand Down
4 changes: 4 additions & 0 deletions group_vars/all/git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
git:
name: Rafael Reggiani Manzo
email: [email protected]
8 changes: 4 additions & 4 deletions roles/common/tasks/git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
check_mode: no
ignore_errors: True
- name: Set git user name
shell: git config --global user.name "{{ git_username }}"
when: host_git_username.stdout != "{{ git_username }}"
shell: git config --global user.name "{{ git.name }}"
when: host_git_username.stdout != "{{ git.name }}"
- name: Check configured git user email
shell: git config --get user.email
register: host_git_useremail
changed_when: False
check_mode: no
ignore_errors: True
- name: Set git user email
shell: git config --global user.email "{{ git_useremail }}"
when: host_git_useremail.stdout != "{{ git_useremail }}"
shell: git config --global user.email "{{ git.email }}"
when: host_git_useremail.stdout != "{{ git.email }}"
2 changes: 0 additions & 2 deletions roles/common/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
---
git_username: Rafael Reggiani Manzo
git_useremail: [email protected]

0 comments on commit 7bd5f3d

Please sign in to comment.