Commit d4f78ef6 by John Jarvis

bashrc changes

parent 50abf52c
...@@ -7,20 +7,21 @@ ...@@ -7,20 +7,21 @@
hosts: all hosts: all
sudo: True sudo: True
gather_facts: False gather_facts: False
vars:
give_sudo: False
pre_tasks: pre_tasks:
- fail: msg="You must pass a user into this play" - fail: msg="You must pass a user into this play"
when: not user when: user is not defined
- name: give access with no sudo - name: give access with no sudo
set_fact: set_fact:
gh_users_no_sudo: user_info:
- "{{ user }}" - name: "{{ user }}"
when: not give_sudo or give_sudo == "false" github: true
when: give_sudo is not defined
- name: give access with sudo - name: give access with sudo
set_fact: set_fact:
gh_users: user_info:
- "{{ user }}" - name: "{{ user }}"
when: give_sudo admin: true
github: true
when: give_sudo is defined
roles: roles:
- gh_users - user
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
- fail: you must pass in a user_info parameter to this role - fail: you must pass in a user_info parameter to this role
when: user_info|length == 0 when: user_info|length == 0
- debug: var=user_info
- name: create the edxadmin group - name: create the edxadmin group
group: name=edxadmin state=present group: name=edxadmin state=present
...@@ -106,7 +108,7 @@ ...@@ -106,7 +108,7 @@
owner={{ item.name }} owner={{ item.name }}
mode=0440 validate='visudo -cf %s' mode=0440 validate='visudo -cf %s'
when: item.authorized_keys is defined when: item.authorized_keys is defined
with_item: user_info with_items: user_info
- name: create bashrc file for normal users - name: create bashrc file for normal users
template: > template: >
...@@ -121,6 +123,7 @@ ...@@ -121,6 +123,7 @@
src=default.profile.j2 src=default.profile.j2
dest=/home/{{ item.name }}/.profile mode=0640 dest=/home/{{ item.name }}/.profile mode=0640
owner={{ item.name }} owner={{ item.name }}
with_items: user_info
######################################################## ########################################################
# All tasks below this line are for restricted users # All tasks below this line are for restricted users
......
...@@ -54,9 +54,9 @@ if [ -n "$force_color_prompt" ]; then ...@@ -54,9 +54,9 @@ if [ -n "$force_color_prompt" ]; then
fi fi
if [ "$color_prompt" = yes ]; then if [ "$color_prompt" = yes ]; then
PS1='{{ GH_USERS_PROMPT }}${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' PS1='{{ USER_CMD_PROMPT }}${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else else
PS1='{{ GH_USERS_PROMPT}}${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' PS1='{{ USER_CMD_PROMPT}}${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi fi
unset color_prompt force_color_prompt unset color_prompt force_color_prompt
...@@ -73,9 +73,6 @@ esac ...@@ -73,9 +73,6 @@ esac
if [ -x /usr/bin/dircolors ]; then if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto' alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto' alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
...@@ -85,6 +82,7 @@ fi ...@@ -85,6 +82,7 @@ fi
alias ll='ls -alF' alias ll='ls -alF'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
alias h='ls ~/.bash_histories/*/* | sort | xargs grep -i '
# better bash history # better bash history
......
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