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
759fd5f6
Commit
759fd5f6
authored
8 years ago
by
Arbab Nazar
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3119 from edx/arbab/ops-1593a
convert sudo_user to become user in roles for Ansible 2.x
parents
e17312da
1389a660
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
18 deletions
+18
-18
playbooks/roles/aide/tasks/main.yml
+1
-1
playbooks/roles/alton/tasks/deploy.yml
+4
-4
playbooks/roles/analytics_api/tasks/main.yml
+7
-7
playbooks/roles/analytics_pipeline/tasks/main.yml
+4
-4
playbooks/roles/aws/tasks/main.yml
+2
-2
No files found.
playbooks/roles/aide/tasks/main.yml
View file @
759fd5f6
...
@@ -21,4 +21,4 @@
...
@@ -21,4 +21,4 @@
command
:
>
command
:
>
aideinit -y -f
aideinit -y -f
creates=/var/lib/aide/aide.db
creates=/var/lib/aide/aide.db
sudo
:
yes
become
:
yes
This diff is collapsed.
Click to expand it.
playbooks/roles/alton/tasks/deploy.yml
View file @
759fd5f6
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
git_2_0_1
:
>
git_2_0_1
:
>
dest="{{ alton_code_dir }}" repo="{{ alton_source_repo }}"
dest="{{ alton_code_dir }}" repo="{{ alton_source_repo }}"
version="{{ alton_version }}" accept_hostkey=yes
version="{{ alton_version }}" accept_hostkey=yes
sudo
_user
:
"
{{
alton_user
}}"
become
_user
:
"
{{
alton_user
}}"
register
:
alton_checkout
register
:
alton_checkout
notify
:
restart alton
notify
:
restart alton
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
virtualenv="{{ alton_venv_dir }}"
virtualenv="{{ alton_venv_dir }}"
state=present
state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo
_user
:
"
{{
alton_user
}}"
become
_user
:
"
{{
alton_user
}}"
notify
:
restart alton
notify
:
restart alton
-
name
:
create the supervisor wrapper
-
name
:
create the supervisor wrapper
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
src=alton.conf.j2 dest="{{ supervisor_available_dir }}/alton.conf"
src=alton.conf.j2 dest="{{ supervisor_available_dir }}/alton.conf"
owner="{{ supervisor_user }}"
owner="{{ supervisor_user }}"
group="{{ supervisor_user }}"
group="{{ supervisor_user }}"
sudo
_user
:
"
{{
supervisor_user
}}"
become
_user
:
"
{{
supervisor_user
}}"
notify
:
restart alton
notify
:
restart alton
-
name
:
enable the supervisor config
-
name
:
enable the supervisor config
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
state=link
state=link
force=yes
force=yes
mode=0644
mode=0644
sudo
_user
:
"
{{
supervisor_user
}}"
become
_user
:
"
{{
supervisor_user
}}"
when
:
not disable_edx_services
when
:
not disable_edx_services
notify
:
restart alton
notify
:
restart alton
...
...
This diff is collapsed.
Click to expand it.
playbooks/roles/analytics_api/tasks/main.yml
View file @
759fd5f6
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
# Example play:
# Example play:
# - name: Deploy Analytics API
# - name: Deploy Analytics API
# hosts: all
# hosts: all
#
sudo
: True
#
become
: True
# gather_facts: True
# gather_facts: True
# vars:
# vars:
# ENABLE_DATADOG: False
# ENABLE_DATADOG: False
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
template
:
>
template
:
>
src=edx/app/analytics_api/analytics_api_gunicorn.py.j2
src=edx/app/analytics_api/analytics_api_gunicorn.py.j2
dest={{ analytics_api_home }}/analytics_api_gunicorn.py
dest={{ analytics_api_home }}/analytics_api_gunicorn.py
sudo
_user
:
"
{{
analytics_api_user
}}"
become
_user
:
"
{{
analytics_api_user
}}"
tags
:
tags
:
-
install
-
install
-
install:configuration
-
install:configuration
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
requirements="{{ analytics_api_requirements_base }}/{{ item }}"
requirements="{{ analytics_api_requirements_base }}/{{ item }}"
virtualenv="{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}"
virtualenv="{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}"
state=present
state=present
sudo
_user
:
"
{{
analytics_api_user
}}"
become
_user
:
"
{{
analytics_api_user
}}"
with_items
:
analytics_api_requirements
with_items
:
analytics_api_requirements
tags
:
tags
:
-
install
-
install
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
DB_MIGRATION_USER='{{ COMMON_MYSQL_MIGRATE_USER }}'
DB_MIGRATION_USER='{{ COMMON_MYSQL_MIGRATE_USER }}'
DB_MIGRATION_PASS='{{ COMMON_MYSQL_MIGRATE_PASS }}'
DB_MIGRATION_PASS='{{ COMMON_MYSQL_MIGRATE_PASS }}'
{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/python ./manage.py migrate --noinput
{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/python ./manage.py migrate --noinput
sudo
_user
:
"
{{
analytics_api_user
}}"
become
_user
:
"
{{
analytics_api_user
}}"
environment
:
"
{{
analytics_api_environment
}}"
environment
:
"
{{
analytics_api_environment
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes"
when
:
migrate_db is defined and migrate_db|lower == "yes"
tags
:
tags
:
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
shell
:
>
shell
:
>
chdir={{ analytics_api_code_dir }}
chdir={{ analytics_api_code_dir }}
{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/python manage.py collectstatic --noinput
{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/python manage.py collectstatic --noinput
sudo
_user
:
"
{{
analytics_api_user
}}"
become
_user
:
"
{{
analytics_api_user
}}"
environment
:
"
{{
analytics_api_environment
}}"
environment
:
"
{{
analytics_api_environment
}}"
tags
:
tags
:
-
assets
-
assets
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
shell
:
>
shell
:
>
chdir={{ analytics_api_code_dir }}
chdir={{ analytics_api_code_dir }}
{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/python manage.py set_api_key {{ item.key }} {{ item.value }}
{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/python manage.py set_api_key {{ item.key }} {{ item.value }}
sudo
_user
:
"
{{
analytics_api_user
}}"
become
_user
:
"
{{
analytics_api_user
}}"
environment
:
"
{{
analytics_api_environment
}}"
environment
:
"
{{
analytics_api_environment
}}"
with_dict
:
ANALYTICS_API_USERS
with_dict
:
ANALYTICS_API_USERS
tags
:
tags
:
...
@@ -164,6 +164,6 @@
...
@@ -164,6 +164,6 @@
config={{ supervisor_cfg }}
config={{ supervisor_cfg }}
name={{ analytics_api_service_name }}
name={{ analytics_api_service_name }}
when
:
not disable_edx_services
when
:
not disable_edx_services
sudo
_user
:
"
{{
supervisor_service_user
}}"
become
_user
:
"
{{
supervisor_service_user
}}"
tags
:
tags
:
-
manage:start
-
manage:start
This diff is collapsed.
Click to expand it.
playbooks/roles/analytics_pipeline/tasks/main.yml
View file @
759fd5f6
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#
#
# - name: Deploy all dependencies of edx-analytics-pipeline to the node
# - name: Deploy all dependencies of edx-analytics-pipeline to the node
# hosts: all
# hosts: all
#
sudo
: True
#
become
: True
# gather_facts: True
# gather_facts: True
# roles:
# roles:
# - analytics_pipeline
# - analytics_pipeline
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
-
name
:
ensure package dir exists in HDFS
-
name
:
ensure package dir exists in HDFS
shell
:
>
shell
:
>
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -mkdir -p /edx-analytics-pipeline/packages/
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -mkdir -p /edx-analytics-pipeline/packages/
sudo
_user
:
"
{{
hadoop_common_user
}}"
become
_user
:
"
{{
hadoop_common_user
}}"
tags
:
tags
:
-
install
-
install
-
install:app-requirements
-
install:app-requirements
...
@@ -144,7 +144,7 @@
...
@@ -144,7 +144,7 @@
-
name
:
ensure util library is in HDFS
-
name
:
ensure util library is in HDFS
shell
:
>
shell
:
>
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -put -f {{ HADOOP_COMMON_USER_HOME }}/lib/edx-analytics-hadoop-util.jar /edx-analytics-pipeline/packages/
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -put -f {{ HADOOP_COMMON_USER_HOME }}/lib/edx-analytics-hadoop-util.jar /edx-analytics-pipeline/packages/
sudo
_user
:
"
{{
hadoop_common_user
}}"
become
_user
:
"
{{
hadoop_common_user
}}"
tags
:
tags
:
-
install
-
install
-
install:app-requirements
-
install:app-requirements
...
@@ -152,7 +152,7 @@
...
@@ -152,7 +152,7 @@
-
name
:
ensure the data directory exists
-
name
:
ensure the data directory exists
shell
:
>
shell
:
>
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -mkdir -p {{ ANALYTICS_PIPELINE_HDFS_DATA_DIR }}
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -mkdir -p {{ ANALYTICS_PIPELINE_HDFS_DATA_DIR }}
sudo
_user
:
"
{{
hadoop_common_user
}}"
become
_user
:
"
{{
hadoop_common_user
}}"
tags
:
tags
:
-
install
-
install
-
install:base
-
install:base
...
...
This diff is collapsed.
Click to expand it.
playbooks/roles/aws/tasks/main.yml
View file @
759fd5f6
...
@@ -142,12 +142,12 @@
...
@@ -142,12 +142,12 @@
-
name
:
restart ssh
-
name
:
restart ssh
service
:
name=ssh state=restarted
service
:
name=ssh state=restarted
sudo
:
True
become
:
True
when
:
sshd_config.changed
when
:
sshd_config.changed
when
:
ansible_distribution in common_debian_variants
when
:
ansible_distribution in common_debian_variants
-
name
:
restart ssh
-
name
:
restart ssh
service
:
name=sshd state=restarted
service
:
name=sshd state=restarted
sudo
:
True
become
:
True
when
:
sshd_config.changed
when
:
sshd_config.changed
when
:
ansible_distribution in common_redhat_variants
when
:
ansible_distribution in common_redhat_variants
This diff is collapsed.
Click to expand it.
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