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
2bc5f266
Unverified
Commit
2bc5f266
authored
Jul 05, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
YAML syntax for ansible tasks
parent
eefa76e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
83 deletions
+91
-83
playbooks/roles/ecommerce/tasks/main.yml
+91
-83
No files found.
playbooks/roles/ecommerce/tasks/main.yml
View file @
2bc5f266
...
...
@@ -20,48 +20,52 @@
# Example play:
#
#
-
name
:
"
add
gunicorn
configuration
file"
template
:
>
src
=edx/app/ecommerce/ecommerce_gunicorn.py.j2
dest
={{ ecommerce_home }}/ecommerce_gunicorn.py
-
name
:
Add gunicorn configuration file
template
:
src
:
"
edx/app/ecommerce/ecommerce_gunicorn.py.j2"
dest
:
"
{{
ecommerce_home
}}/ecommerce_gunicorn.py"
become_user
:
"
{{
ecommerce_user
}}"
-
name
:
i
nstall application requirements
pip
:
>
requirements
=
"{{ ecommerce_requirements_base }}/{{ item }}"
virtualenv
=
"{{ ecommerce_venv_dir }}"
state
=
present
-
name
:
I
nstall application requirements
pip
:
requirements
:
"
{{
ecommerce_requirements_base
}}/{{
item
}}"
virtualenv
:
"
{{
ecommerce_venv_dir
}}"
state
:
present
become_user
:
"
{{
ecommerce_user
}}"
with_items
:
ecommerce_requirements
with_items
:
"
{{
ecommerce_requirements
}}"
-
name
:
c
reate nodeenv
shell
:
>
creates={{ ecommerce_nodeenv_dir }}
{{ ecommerce_venv_dir }}/bin/nodeenv {{ ecommerce_nodeenv_dir }} --prebuilt
-
name
:
C
reate nodeenv
shell
:
"
{{
ecommerce_venv_dir
}}/bin/nodeenv
{{
ecommerce_nodeenv_dir
}}
--prebuilt"
args
:
creates
:
"
{{
ecommerce_nodeenv_dir
}}"
become_user
:
"
{{
ecommerce_user
}}"
-
name
:
install node dependencies
npm
:
executable={{ ecommerce_nodeenv_bin }}/npm path={{ ecommerce_code_dir }} production=yes
-
name
:
Install node dependencies
npm
:
executable
:
"
{{
ecommerce_nodeenv_bin
}}/npm"
path
:
"
{{
ecommerce_code_dir
}}"
production
:
yes
become_user
:
"
{{
ecommerce_user
}}"
environment
:
"
{{
ecommerce_environment
}}"
-
name
:
i
nstall bower dependencies
shell
:
>
chdir={{ ecommerce_code_dir }}
. {{ ecommerce_nodeenv_bin }}/activate && {{ ecommerce_node_bin }}/bower install --production --config.interactive=false
-
name
:
I
nstall bower dependencies
shell
:
"
.
{{
ecommerce_nodeenv_bin
}}/activate
&&
{{
ecommerce_node_bin
}}/bower
install
--production
--config.interactive=false"
args
:
chdir
:
"
{{
ecommerce_code_dir
}}"
become_user
:
"
{{
ecommerce_user
}}"
-
name
:
m
igrate
-
name
:
M
igrate
shell
:
>
chdir={{ ecommerce_code_dir }}
DB_MIGRATION_USER='{{ COMMON_MYSQL_MIGRATE_USER }}'
DB_MIGRATION_PASS='{{ COMMON_MYSQL_MIGRATE_PASS }}'
{{ ecommerce_venv_dir }}/bin/python ./manage.py migrate --noinput
args
:
chdir
:
"
{{
ecommerce_code_dir
}}"
become_user
:
"
{{
ecommerce_user
}}"
environment
:
"
{{
ecommerce_environment
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes"
-
name
:
p
opulate countries
-
name
:
P
opulate countries
shell
:
>
chdir={{ ecommerce_code_dir }}
DB_MIGRATION_USER={{ COMMON_MYSQL_MIGRATE_USER }}
...
...
@@ -79,26 +83,26 @@
-
"
command_result.rc
!=
0"
-
name
:
compile sass
shell
:
>
chdir={{ ecommerce_code_dir }}
{{ ecommerce_venv_dir }}/bin/python manage.py {{ item }}
shell
:
"
{{
ecommerce_venv_dir
}}/bin/python
manage.py
{{
item
}}"
args
:
chdir
:
"
{{
ecommerce_code_dir
}}"
become_user
:
"
{{
ecommerce_user
}}"
environment
:
"
{{
ecommerce_environment
}}"
with_items
:
-
"
update_assets
--skip-collect"
when
:
not devstack
-
name
:
r
un r.js optimizer
shell
:
>
chdir={{ ecommerce_code_dir }}
. {{ ecommerce_nodeenv_bin }}/activate && {{ ecommerce_node_bin }}/r.js -o build.js
-
name
:
R
un r.js optimizer
shell
:
"
.
{{
ecommerce_nodeenv_bin
}}/activate
&&
{{
ecommerce_node_bin
}}/r.js
-o
build.js"
args
:
chdir
:
"
{{
ecommerce_code_dir
}}"
become_user
:
"
{{
ecommerce_user
}}"
when
:
not devstack
-
name
:
r
un collectstatic
shell
:
>
chdir={{ ecommerce_code_dir }}
{{ ecommerce_venv_dir }}/bin/python manage.py {{ item }}
-
name
:
R
un collectstatic
shell
:
"
{{
ecommerce_venv_dir
}}/bin/python
manage.py
{{
item
}}"
args
:
chdir
:
"
{{
ecommerce_code_dir
}}"
become_user
:
"
{{
ecommerce_user
}}"
environment
:
"
{{
ecommerce_environment
}}"
with_items
:
...
...
@@ -106,61 +110,65 @@
-
"
compress"
when
:
not devstack
-
name
:
write out the supervisor wrapper
template
:
>
src=edx/app/ecommerce/ecommerce.sh.j2
dest={{ ecommerce_home }}/{{ ecommerce_service_name }}.sh
mode=0650 owner={{ supervisor_user }} group={{ common_web_user }}
-
name
:
write supervisord config
template
:
>
src=edx/app/supervisor/conf.d.available/ecommerce.conf.j2
dest="{{ supervisor_available_dir }}/{{ ecommerce_service_name }}.conf"
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
-
name
:
setup the ecommence env file
template
:
>
src="./{{ ecommerce_home }}/{{ ecommerce_service_name }}_env.j2"
dest="{{ ecommerce_home }}/ecommerce_env"
owner={{ ecommerce_user }}
group={{ ecommerce_user }}
mode=0644
-
name
:
enable supervisor script
file
:
>
src={{ supervisor_available_dir }}/{{ ecommerce_service_name }}.conf
dest={{ supervisor_cfg_dir }}/{{ ecommerce_service_name }}.conf
state=link
force=yes
-
name
:
Write out the supervisor wrapper
template
:
src
:
"
edx/app/ecommerce/ecommerce.sh.j2"
dest
:
"
{{
ecommerce_home
}}/{{
ecommerce_service_name
}}.sh"
mode
:
"
0650"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
common_web_user
}}"
-
name
:
Write supervisord config
template
:
src
:
"
edx/app/supervisor/conf.d.available/ecommerce.conf.j2"
dest
:
"
{{
supervisor_available_dir
}}/{{
ecommerce_service_name
}}.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
"
0644"
-
name
:
Setup the ecommence env file
template
:
src
:
"
./{{
ecommerce_home
}}/{{
ecommerce_service_name
}}_env.j2"
dest
:
"
{{
ecommerce_home
}}/ecommerce_env"
owner
:
"
{{
ecommerce_user
}}"
group
:
"
{{
ecommerce_user
}}"
mode
:
"
0644"
-
name
:
Enable supervisor script
file
:
src
:
"
{{
supervisor_available_dir
}}/{{
ecommerce_service_name
}}.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/{{
ecommerce_service_name
}}.conf"
state
:
link
force
:
yes
when
:
not disable_edx_services
-
name
:
u
pdate supervisor configuration
-
name
:
U
pdate supervisor configuration
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update"
when
:
not disable_edx_services
-
name
:
c
reate symlinks from the-er venv bin dir
file
:
>
src
=
"{{ ecommerce_venv_dir }}/bin/{{ item }}"
dest
="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0]
}}.ecommerce"
state
=
link
-
name
:
C
reate symlinks from the-er venv bin dir
file
:
src
:
"
{{
ecommerce_venv_dir
}}/bin/{{
item
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
item..split('.',
1)
|
first
}}.ecommerce"
state
:
link
with_items
:
-
python
-
pip
-
django-admin.py
-
name
:
c
reate symlinks from the repo dir
file
:
>
src
=
"{{ ecommerce_code_dir }}/{{ item }}"
dest
="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0]
}}.ecommerce"
state
=
link
-
python
-
pip
-
django-admin.py
-
name
:
C
reate symlinks from the repo dir
file
:
src
:
"
{{
ecommerce_code_dir
}}/{{
item
}}"
dest
:
"
{{
COMMON_BIN_DIR
}}/{{
item..split('.',
1)
|
first
}}.ecommerce"
state
:
link
with_items
:
-
manage.py
-
name
:
r
estart the applicaton
supervisorctl
:
>
state=restarted
s
upervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
name={{ ecommerce_service_name }}
-
manage.py
-
name
:
R
estart the applicaton
supervisorctl
:
name
:
"
{{
ecommerce_service_name
}}"
s
tate
:
restarted
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
when
:
not disable_edx_services
become_user
:
"
{{
supervisor_service_user
}}"
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