diff --git a/defaults/main.yml b/defaults/main.yml index 004349d..1f7c27a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,5 +6,6 @@ bash: nm: false pwgen: true shell: "/bin/bash" - 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\] ' + keyboard: '$(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\] ' + diff --git a/tasks/main.yml b/tasks/main.yml index af32a67..a371609 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,6 @@ --- +- debug: var=bash + - name: install the latest libselinux-python package dnf: name: libselinux-python diff --git a/templates/bash.bashrc b/templates/bash.bashrc index 61788b8..990c693 100644 --- a/templates/bash.bashrc +++ b/templates/bash.bashrc @@ -47,16 +47,16 @@ if [ -z "$BASHRCSOURCED" ]; then # Turn on checkwinsize shopt -s checkwinsize [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " -{% endraw %} # You might want to have e.g. tty in prompt (e.g. more virtual machines) # and console windows # If you want to do so, just add e.g. if [ "$PS1" ]; then - PS1='{{ bash.ps1 }}' +{% endraw %} + PS1="{{ bash['keyboard'] }}" +{% raw %} fi # to your custom modification shell script in /etc/profile.d/ directory fi -{% raw %} if ! shopt -q login_shell ; then # We're not a login shell # Need to redefine pathmunge, it gets undefined at the end of /etc/profile @@ -84,7 +84,8 @@ if ! shopt -q login_shell ; then # We're not a login shell fi {% endraw %} - SHELL={{ bash.shell }} + SHELL="{{ bash['shell'] }}" + {% raw %} # Only display echos from profile.d scripts if we are no login shell # and interactive - otherwise just process them to set envvars @@ -118,7 +119,8 @@ export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quo alias ll='ls -la' alias la='ls -A' alias l='ls -CF' +{% endraw %} -{% if bash.pwgen %}alias pwgen="/usr/bin/pwgen --num-passwords=3000 --numerals --capitalize --secure --no-vowels --symbols 42 | grep -v '0' | grep -v 'o' | grep -v 'O' | grep -v '\"' | grep -v 'I' | grep -v 'l' | grep -v '1' | grep -v '´' | grep -v '@' | tail -1 "{% endif %} +{% if bash['pwgen'] %}alias pwgen="/usr/bin/pwgen --num-passwords=3000 --numerals --capitalize --secure --no-vowels --symbols 42 | grep -v '0' | grep -v 'o' | grep -v 'O' | grep -v '\"' | grep -v 'I' | grep -v 'l' | grep -v '1' | grep -v '´' | grep -v '@' | tail -1 "{% endif %} # vim:ts=4:sw=4 diff --git a/templates/bashrc b/templates/bashrc index 99f8f40..0271e3e 100644 --- a/templates/bashrc +++ b/templates/bashrc @@ -14,7 +14,7 @@ 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 }} +{{ bash['bashrc'] }} # User specific aliases and functions alias ll="ls -all"