- git --version
git version 2.17.1
- sudo apt-get install libsecret-1-0 libsecret-1-dev
- cd /usr/share/doc/git/contrib/credential/libsecret
- sudo make
- git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
- Next time Git asked for GitHub's username an password, just write your username and paste your token and they'll be stored in your keyring.
- name: Use gnome keyring credential helper (gui password prompt)
when: '"gnome-keyring-credential-helper" is defined and "gnome-keyring-credential-helper" in configure'
block:
- name: "[gnome-keyring-credential-helper]: packages"
apt:
name: "{{ item }}"
state: latest
loop:
- libsecret-1-0
- libsecret-1-dev
- name: "[gnome-keyring-credential-helper]: verify if already compiled"
stat:
path: /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
register: git_credential
- name: "[gnome-keyring-credential-helper]: build library"
when: not git_credential.stat.exists
make:
chdir: /usr/share/doc/git/contrib/credential/libsecret
target: all
- name: "[gnome-keyring-credential-helper]: configure git global credential.helper"
git_config:
name: credential.helper
scope: global
value: "/usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret"
changed_when: False
What you have wrote is very helpful. Thanks!