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
6d280c2f
Commit
6d280c2f
authored
Jun 21, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use YAML syntax
parent
1ab59651
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
61 deletions
+72
-61
playbooks/roles/xsy/handlers/main.yml
+5
-5
playbooks/roles/xsy/tasks/main.yml
+59
-49
playbooks/roles/xsy/tasks/tag_ec2.yml
+8
-7
No files found.
playbooks/roles/xsy/handlers/main.yml
View file @
6d280c2f
...
...
@@ -15,9 +15,9 @@
#
#
-
name
:
restart xsy
supervisorctl
:
>
name
=
xsy
supervisorctl_path
={{ supervisor_ctl }}
config
={{ supervisor_cfg }}
state
=
restarted
supervisorctl
:
name
:
xsy
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
restarted
when
:
not disable_edx_services
playbooks/roles/xsy/tasks/main.yml
View file @
6d280c2f
...
...
@@ -20,84 +20,94 @@
# Example play:
#
#
-
name
:
Create application user
user
:
name
:
"
{{
xsy_user
}}"
home
:
"
{{
xsy_app_dir
}}"
createhome
:
no
shell
:
/bin/false
-
name
:
create application user
user
:
>
name="{{ xsy_user }}" home="{{ xsy_app_dir }}"
createhome=no shell=/bin/false
-
name
:
create xsy user dirs
file
:
>
path="{{ item }}" state=directory
owner="{{ xsy_user }}" group="{{ common_web_group }}"
-
name
:
Create xsy user dirs
file
:
path
:
"
{{
item
}}"
state
:
directory
owner
:
"
{{
xsy_user
}}"
group
:
"
{{
common_web_group
}}"
with_items
:
-
"
{{
xsy_app_dir
}}"
-
"
{{
xsy_venvs_dir
}}"
-
name
:
setup the xsy env
template
:
>
src="xsy_env.j2" dest="{{ xsy_app_dir }}/xsy_env"
owner="{{ xsy_user }}" group="{{ common_web_user }}"
mode=0644
-
name
:
Setup the xsy env
template
:
src
:
"
xsy_env.j2"
dest
:
"
{{
xsy_app_dir
}}/xsy_env"
owner
:
"
{{
xsy_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
"
0644"
notify
:
restart xsy
-
name
:
checkout the code
git_2_0_1
:
>
dest="{{ xsy_code_dir }}" repo="{{ xsy_source_repo }}"
version="{{ xsy_version }}" accept_hostkey=yes
-
name
:
Checkout the code
git_2_0_1
:
dest
:
"
{{
xsy_code_dir
}}"
repo
:
"
{{
xsy_source_repo
}}"
version
:
"
{{
xsy_version
}}"
accept_hostkey
:
yes
become_user
:
"
{{
xsy_user
}}"
register
:
xsy_checkout
notify
:
restart xsy
-
name
:
i
nstall the requirements
pip
:
>
requirements
=
"{{ xsy_requirements_file }}"
virtualenv
=
"{{ xsy_venv_dir }}"
state
=
present
extra_args
=
"-i {{ COMMON_PYPI_MIRROR_URL }}"
-
name
:
I
nstall the requirements
pip
:
requirements
:
"
{{
xsy_requirements_file
}}"
virtualenv
:
"
{{
xsy_venv_dir
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}"
become_user
:
"
{{
xsy_user
}}"
notify
:
restart xsy
-
name
:
c
reate the supervisor wrapper
template
:
>
src
="{{ xsy_supervisor_wrapper|
basename }}.j2"
dest
=
"{{ xsy_supervisor_wrapper }}"
mode
=0755
-
name
:
C
reate the supervisor wrapper
template
:
src
:
"
{{
xsy_supervisor_wrapper
|
basename
}}.j2"
dest
:
"
{{
xsy_supervisor_wrapper
}}"
mode
:
"
0755"
become_user
:
"
{{
xsy_user
}}"
notify
:
restart xsy
-
name
:
create a supervisor config
template
:
>
src=xsy.conf.j2 dest="{{ supervisor_available_dir }}/xsy.conf"
owner="{{ supervisor_user }}"
group="{{ supervisor_user }}"
-
name
:
Create a supervisor config
template
:
src
:
"
xsy.conf.j2"
dest
:
"
{{
supervisor_available_dir
}}/xsy.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
supervisor_user
}}"
become_user
:
"
{{
supervisor_user
}}"
notify
:
restart xsy
-
name
:
e
nable the supervisor config
file
:
>
src
=
"{{ supervisor_available_dir }}/xsy.conf"
dest
=
"{{ supervisor_cfg_dir }}/xsy.conf"
state
=
link
force
=
yes
mode
=0644
-
name
:
E
nable the supervisor config
file
:
src
:
"
{{
supervisor_available_dir
}}/xsy.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/xsy.conf"
state
:
link
force
:
yes
mode
:
"
0644"
become_user
:
"
{{
supervisor_user
}}"
when
:
not disable_edx_services
notify
:
restart xsy
-
name
:
u
pdate supervisor configuration
-
name
:
U
pdate supervisor configuration
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update"
register
:
supervisor_update
changed_when
:
supervisor_update.stdout is defined and supervisor_update.stdout != ""
when
:
not disable_edx_services
-
name
:
e
nsure xsy is started
supervisorctl
:
>
name
=
xsy
supervisorctl_path
={{ supervisor_ctl }}
config
={{ supervisor_cfg }}
state
=
started
-
name
:
E
nsure xsy is started
supervisorctl
:
name
:
xsy
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
started
when
:
not disable_edx_services
-
include
:
tag_ec2.yml
tags=deploy
-
include
:
tag_ec2.yml
when
:
COMMON_TAG_EC2_INSTANCE
tags
:
-
deploy
playbooks/roles/xsy/tasks/tag_ec2.yml
View file @
6d280c2f
...
...
@@ -3,13 +3,14 @@
-
name
:
get instance information
action
:
ec2_facts
tags
:
-
deploy
-
deploy
-
name
:
tag instance
ec2_tag
:
resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args
:
tags
:
"
version:xsy"
:
"
{{
xsy_source_repo
}}
{{
xsy_checkout.after
|truncate(7,True,'')}}"
-
name
:
Tag instance
ec2_tag
:
resource
:
"
{{
ansible_ec2_instance_id
}}"
region
:
"
{{
ansible_ec2_placement_region
}}"
tags
:
"
version:xsy"
:
"
{{
xsy_source_repo
}}
{{
xsy_checkout.after
|truncate(7,True,'')}}"
when
:
xsy_checkout.after is defined
tags
:
-
deploy
-
deploy
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