mirror of
https://github.com/roles-ansible/ansible_role_dotfiles.git
synced 2024-08-16 16:09:49 +02:00
Use a tmeplate
This commit is contained in:
parent
44d73953ff
commit
c3fc3d3c54
2 changed files with 10 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
||||||
when: ansible_distribution == "Fedora"
|
when: ansible_distribution == "Fedora"
|
||||||
|
|
||||||
- name: Create a global bashrc configuration
|
- name: Create a global bashrc configuration
|
||||||
copy:
|
template:
|
||||||
src: 'templates/bash.bashrc'
|
src: 'templates/bash.bashrc'
|
||||||
dest: '/etc/bash.bashrc'
|
dest: '/etc/bash.bashrc'
|
||||||
owner: root
|
owner: root
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# /etc/bashrc
|
# /etc/bashrc
|
||||||
|
{% raw %}
|
||||||
|
|
||||||
# System wide functions and aliases
|
# System wide functions and aliases
|
||||||
# Environment stuff goes in /etc/profile
|
# Environment stuff goes in /etc/profile
|
||||||
|
@ -8,6 +9,9 @@
|
||||||
# /etc/profile.d/ to make custom changes to your environment, as this
|
# /etc/profile.d/ to make custom changes to your environment, as this
|
||||||
# will prevent the need for merging in future updates.
|
# will prevent the need for merging in future updates.
|
||||||
|
|
||||||
|
# This file may be overwritten by ansible. Please think about commiting
|
||||||
|
# changes you want to keep persistent.
|
||||||
|
|
||||||
# Prevent doublesourcing
|
# Prevent doublesourcing
|
||||||
if [ -z "$BASHRCSOURCED" ]; then
|
if [ -z "$BASHRCSOURCED" ]; then
|
||||||
BASHRCSOURCED="Y"
|
BASHRCSOURCED="Y"
|
||||||
|
@ -43,6 +47,7 @@ if [ -z "$BASHRCSOURCED" ]; then
|
||||||
# Turn on checkwinsize
|
# Turn on checkwinsize
|
||||||
shopt -s checkwinsize
|
shopt -s checkwinsize
|
||||||
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
|
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
|
||||||
|
{% endraw %}
|
||||||
# You might want to have e.g. tty in prompt (e.g. more virtual machines)
|
# You might want to have e.g. tty in prompt (e.g. more virtual machines)
|
||||||
# and console windows
|
# and console windows
|
||||||
# If you want to do so, just add e.g.
|
# If you want to do so, just add e.g.
|
||||||
|
@ -51,8 +56,9 @@ if [ -z "$BASHRCSOURCED" ]; then
|
||||||
fi
|
fi
|
||||||
# to your custom modification shell script in /etc/profile.d/ directory
|
# to your custom modification shell script in /etc/profile.d/ directory
|
||||||
fi
|
fi
|
||||||
|
{% raw %}
|
||||||
|
|
||||||
if ! shopt -q login_shell ; then # We're not a login shell
|
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
|
# Need to redefine pathmunge, it gets undefined at the end of /etc/profile
|
||||||
pathmunge () {
|
pathmunge () {
|
||||||
case ":${PATH}:" in
|
case ":${PATH}:" in
|
||||||
|
@ -76,8 +82,10 @@ if [ -z "$BASHRCSOURCED" ]; then
|
||||||
else
|
else
|
||||||
umask 022
|
umask 022
|
||||||
fi
|
fi
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
SHELL={{ bash.shell }}
|
SHELL={{ bash.shell }}
|
||||||
|
|
||||||
# Only display echos from profile.d scripts if we are no login shell
|
# Only display echos from profile.d scripts if we are no login shell
|
||||||
# and interactive - otherwise just process them to set envvars
|
# and interactive - otherwise just process them to set envvars
|
||||||
for i in /etc/profile.d/*.sh; do
|
for i in /etc/profile.d/*.sh; do
|
||||||
|
|
Loading…
Reference in a new issue