Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
d4f78ef6
Commit
d4f78ef6
authored
Feb 26, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bashrc changes
parent
50abf52c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
playbooks/edx-east/create_user.yml
+11
-10
playbooks/roles/user/tasks/main.yml
+4
-1
playbooks/roles/user/templates/default.bashrc.j2
+3
-5
No files found.
playbooks/edx-east/create_user.yml
View file @
d4f78ef6
...
@@ -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
playbooks/roles/user/tasks/main.yml
View file @
d4f78ef6
...
@@ -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_item
s
:
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
...
...
playbooks/roles/user/templates/default.bashrc.j2
View file @
d4f78ef6
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment