mirror of
https://github.com/roles-ansible/ansible_role_dotfiles.git
synced 2024-08-16 16:09:49 +02:00
improve optional keychain handling
This commit is contained in:
parent
50c07f9028
commit
1a6c710263
3 changed files with 14 additions and 3 deletions
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
# should we install keychain for ssh-add support?
|
||||
install_keychain: False
|
||||
|
||||
# some bash variables
|
||||
bash:
|
||||
bashrc: 'eval $(keychain --eval --quiet id_ed25519)'
|
||||
bashrc: ''
|
||||
keychain: 'eval $(keychain --eval --quiet id_ed25519)'
|
||||
nextcloud: false
|
||||
nm: false
|
||||
pwgen: true
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
dnf:
|
||||
name: libselinux-python
|
||||
state: latest
|
||||
when: ansible_distribution == "Fedora"
|
||||
when:
|
||||
- ansible_distribution == "Fedora"
|
||||
|
||||
- name: install keychain to support ssh agent
|
||||
become: yes
|
||||
|
@ -14,6 +15,7 @@
|
|||
state: latest
|
||||
when:
|
||||
- ansible_os_family != 'RedHat'
|
||||
- install_keychain
|
||||
|
||||
- name: install keychain on centos
|
||||
become: yes
|
||||
|
@ -22,7 +24,9 @@
|
|||
- http://packages.psychotic.ninja/7/base/x86_64/RPMS//keychain-2.8.0-3.el7.psychotic.noarch.rpm
|
||||
- libselinux-python
|
||||
state: present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- install_keychain
|
||||
|
||||
- name: Create a global bashrc configuration
|
||||
become: yes
|
||||
|
|
|
@ -15,6 +15,9 @@ export PATH
|
|||
PS1='$(if [[ $(id -u) -ne 0 ]];then echo "\[\033[01;33m\]"; else echo "\[\033[01;31m\]"; fi) $(if [[ $? == 0 ]]; then printf "\xE2\x9D\xA4"; fi) \[\033[01;32m\]\u\[\033[01;36m\]@\[\033[01;32m\]\H\[\033[01;34m\] <\A> \[\033[01;35m\] \j \[\033[01;36m\] \w \[\033[01;33m\]\n\[\033[01;33m\] $(git branch 2>/dev/null | sed -n "s/* \(.*\)/\1 /p")$\[\033[01;00m\] '
|
||||
|
||||
{{ bash['bashrc'] }}
|
||||
{% if install_keychain %}
|
||||
{{ bash['keychain'] }}
|
||||
{% endif %}
|
||||
|
||||
# User specific aliases and functions
|
||||
alias ll="ls -all"
|
||||
|
|
Loading…
Reference in a new issue