Commit 917a30b9 by John Jarvis

moving prompt default to the gh_users role

parent ee372d1b
......@@ -20,11 +20,6 @@ COMMON_PYPI_MIRROR_URL: 'https://pypi.python.org/simple'
COMMON_GIT_MIRROR: 'github.com'
# override this var to set a different hostname
COMMON_HOSTNAME: !!null
# override this var to add a prefix to the prompt
# also need to set commont_update_bashrc for to
# update the system bashrc default
COMMON_PROMPT: ""
common_debian_pkgs:
- ack-grep
......@@ -47,4 +42,3 @@ common_pip_pkgs:
common_web_user: www-data
common_web_group: www-data
common_log_user: syslog
common_update_bashrc: false
......@@ -60,7 +60,3 @@
shell: >
hostname -F /etc/hostname
when: COMMON_HOSTNAME and (etc_hosts.changed or etc_hostname.changed)
- name: common | set global bashrc
template: src=bash.bashrc.j2 dest=/etc/bash.bashrc
when: common_update_bashrc
# {{ ansible_managed }}
# System-wide .bashrc file for interactive bash(1) shells.
# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='{{ COMMON_PROMPT }}${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# keep a full history log
if [ "$BASH_VERSINFO" -ge 2 ]; then
shopt -s cdspell
shopt -s checkwinsize
shopt -s cmdhist
shopt -s histappend
shopt -s checkhash
shopt -s no_empty_cmd_completion
shopt -s execfail
HISTFILESIZE=10000
HISTDIR="$HOME/.bash_histories/`uname -n`"
[[ ! -d $HISTDIR ]] && mkdir -p "$HISTDIR"
HISTFILE="$HISTDIR/`date +%Y_%m`"
# Suppress duplicates, bare "ls" and bg,fg and exit
HISTIGNORE="&:ls:[bf]g:exit"
fi
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- "$1"
return $?
elif [ -x /usr/share/command-not-found/command-not-found ]; then
/usr/bin/python /usr/share/command-not-found/command-not-found -- "$1"
return $?
else
printf "%s: command not found\n" "$1" >&2
return 127
fi
}
fi
......@@ -16,6 +16,11 @@
fail: msg="gh_users list must be defined for this parameterized role"
when: not gh_users
- name: gh_users | creating default .bashrc
template: >
src=default.bashrc.j2 dest=/etc/skel/.bashrc
mode=0644 owner=root group=root
- name: gh_users | create gh group
group: name=gh state=present
......
......@@ -94,8 +94,7 @@ gh_users:
- ${github_username}
dns_zone: $dns_zone
rabbitmq_refresh: True
common_update_bashrc: true
COMMON_PROMPT: '[$name_tag] '
GH_USERS_PROMPT: '[$name_tag] '
EOF
cat $extra_vars
# run the tasks to launch an ec2 instance from AMI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment