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
edx
configuration
Commits
184f1521
Unverified
Commit
184f1521
authored
Jun 17, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bare variables is deprecated warning
parent
0a993c8d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
playbooks/roles/common/tasks/main.yml
+4
-4
playbooks/roles/server_utils/tasks/main.yml
+2
-3
playbooks/roles/user/tasks/main.yml
+11
-11
No files found.
playbooks/roles/common/tasks/main.yml
View file @
184f1521
...
...
@@ -59,7 +59,7 @@
install_recommends
:
yes
state
:
present
update_cache
:
yes
with_items
:
common_debian_pkgs
with_items
:
"
{{
common_debian_pkgs
}}"
when
:
ansible_distribution in common_debian_variants
-
name
:
Install role-independent useful system packages
...
...
@@ -67,7 +67,7 @@
name
:
"
{{
item
}}"
state
:
present
update_cache
:
yes
with_items
:
common_redhat_pkgs
with_items
:
"
{{
common_redhat_pkgs
}}"
when
:
ansible_distribution in common_redhat_variants
...
...
@@ -78,7 +78,7 @@
owner
:
"
{{
item.owner
|
default('root')
}}"
group
:
"
{{
item.group
|
default('root')
}}"
mode
:
0755
with_items
:
common_directories
with_items
:
"
{{
common_directories
}}"
-
name
:
upload sudo config for key forwarding as root
copy
:
...
...
@@ -94,7 +94,7 @@
name
:
"
{{
item
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}"
with_items
:
common_pip_pkgs
with_items
:
"
{{
common_pip_pkgs
}}"
when
:
ansible_distribution in common_debian_variants
...
...
playbooks/roles/server_utils/tasks/main.yml
View file @
184f1521
...
...
@@ -27,6 +27,5 @@
install_recommends
:
yes
state
:
present
update_cache
:
yes
with_items
:
server_utils_debian_pkgs
when
:
-
ansible_distribution == 'Ubuntu'
with_items
:
"
{{
server_utils_debian_pkgs
}}"
when
:
ansible_distribution == 'Ubuntu'
playbooks/roles/user/tasks/main.yml
View file @
184f1521
...
...
@@ -104,21 +104,21 @@
shell
:
/bin/bash
remove
:
yes
state
:
"
{{
item.state
|
default('present')
}}"
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
assign admin role to admin users
user
:
name
:
"
{{
item.name
}}"
groups
:
edxadmin
when
:
item.type is defined and item.type == 'admin' and item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
get github key(s) and update the authorized_keys file
authorized_key
:
user
:
"
{{
item.name
}}"
key
:
"
https://github.com/{{
item.name
}}.keys"
when
:
item.github is defined and item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
create bashrc file for normal users
template
:
...
...
@@ -127,7 +127,7 @@
mode
:
0640
owner
:
"
{{
item.name
}}"
when
:
not (item.type is defined and item.type == 'restricted') and item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
create .profile for all users
template
:
...
...
@@ -136,7 +136,7 @@
mode
:
0640
owner
:
"
{{
item.name
}}"
when
:
item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
########################################################
# All tasks below this line are for restricted users
...
...
@@ -146,7 +146,7 @@
name
:
"
{{
item.name
}}"
shell
:
/bin/rbash
when
:
item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
create bashrc file for restricted users
template
:
...
...
@@ -155,7 +155,7 @@
mode
:
0640
owner
:
"
{{
item.name
}}"
when
:
item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
create sudoers file from template
template
:
...
...
@@ -172,7 +172,7 @@
-
name
:
change home directory ownership to root for restricted users
shell
:
"
chown
-R
root:{{
item.name
}}
/home/{{
item.name
}}"
when
:
item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
create ~/bin directory
file
:
...
...
@@ -182,7 +182,7 @@
owner
:
root
group
:
"
{{
item.name
}}"
when
:
item.type is defined and item.type == 'restricted' and item.get('state', 'present') == 'present'
with_items
:
user_info
with_items
:
"
{{
user_info
}}"
-
name
:
create allowed command links
file
:
...
...
@@ -191,5 +191,5 @@
state
:
link
when
:
item[0].type is defined and item[0].type == 'restricted' and item[0].get('state', 'present') == 'present'
with_nested
:
-
user_info
-
user_rbash_links
-
"
{{
user_info
}}"
-
"
{{
user_rbash_links
}}"
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