GIT configuration using ansible

18 views
Skip to first unread message

surabhy vaishakh

unread,
Aug 24, 2020, 1:55:17 AM8/24/20
to Ansible Project
Hello Team,

I want to install git using  ansible and try to configure using below commands.

git config --global user.name "Your Name" (Choose a proper name. Eg: surabhy.mr)
git config --global user.email "sura...@gmail.com"

I am able to install GIT but unable to configure.

---
- hosts: win
  gather_facts: true
  tasks:
# Make etckeeper not complain when invoked by cron
  - git_config:
      name: user.name
      scope: global
      value: 'surabhy.mr'
  - git_config:
      name: user.email
      scope: global
      value: 'sura...@gmail.com

Pls help asap'


Karl Auer

unread,
Aug 24, 2020, 2:17:36 AM8/24/20
to ansible-project
Are the global values not set, or are they set but not used? Wondering if --system would be more appropriate than --global. If you use --global, then it will set the values for whatever user Ansible is connecting as. This may or may not be the right user for later git usage.

--local is per- repository, --global is per-user (but may be overridden by --local), and --system is for everyone (but may be overridden by --global or --local).

You should be able to find out what is being set by inspecting the local, global and system locations after Ansible runs. I don't know what they are in Windows, but for Linux they would be <repodir>/.git/config, ~/.gitconfig, and /etc/gitconfig respectively.

Regards, K.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c084db28-cdad-46cd-b913-a9e07c16a9dcn%40googlegroups.com.


--

Karl Auer { manager, systems support }
P: 1300 759 975
E: ka...@2pisoftware.com
2pisoftware.com

GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
Reply all
Reply to author
Forward
0 new messages