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
d02435b1
Commit
d02435b1
authored
Jun 20, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write ansible tasks with proper YAML syntax
parent
27512714
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
66 deletions
+75
-66
playbooks/roles/alton/handlers/main.yml
+5
-5
playbooks/roles/alton/tasks/deploy.yml
+51
-49
playbooks/roles/alton/tasks/main.yml
+15
-9
playbooks/roles/alton/tasks/tag_ec2.yml
+4
-3
No files found.
playbooks/roles/alton/handlers/main.yml
View file @
d02435b1
...
...
@@ -15,9 +15,9 @@
#
#
-
name
:
restart alton
supervisorctl
:
>
name
=
alton
supervisorctl_path
={{ supervisor_ctl }}
config
={{ supervisor_cfg }}
state
=
restarted
supervisorctl
:
name
:
alton
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
restarted
when
:
not disable_edx_services
playbooks/roles/alton/tasks/deploy.yml
View file @
d02435b1
-
name
:
setup the alton env
template
:
>
src="alton_env.j2" dest="{{ alton_app_dir }}/alton_env"
owner="{{ alton_user }}" group="{{ common_web_user }}"
mode=0644
---
-
name
:
Setup the env and configure the boto profiles for alton
template
:
src
:
"
{{
item.src
}}"
dest
:
"
{{
alton_app_dir
}}/{{
item.dest
}}"
owner
:
"
{{
alton_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
"
0640"
with_items
:
-
{
src
:
'
alton_env.j2'
,
dest
:
'
alton_env'
}
-
{
src
:
'
boto.j2'
,
dest
:
'
.boto'
}
notify
:
restart alton
-
name
:
configure the boto profiles for alton
template
:
>
src="boto.j2"
dest="{{ alton_app_dir }}/.boto"
owner="{{ alton_user }}"
group="{{ common_web_user }}"
mode="0640"
notify
:
restart alton
-
name
:
checkout the code
git_2_0_1
:
>
dest="{{ alton_code_dir }}" repo="{{ alton_source_repo }}"
version="{{ alton_version }}" accept_hostkey=yes
-
name
:
Checkout the code
git_2_0_1
:
dest
:
"
{{
alton_code_dir
}}"
repo
:
"
{{
alton_source_repo
}}"
version
:
"
{{
alton_version
}}"
accept_hostkey
:
yes
become_user
:
"
{{
alton_user
}}"
register
:
alton_checkout
notify
:
restart alton
-
name
:
i
nstall the requirements
pip
:
>
requirements
=
"{{ alton_requirements_file }}"
virtualenv
=
"{{ alton_venv_dir }}"
state
=
present
extra_args
=
"-i {{ COMMON_PYPI_MIRROR_URL }}"
-
name
:
I
nstall the requirements
pip
:
requirements
:
"
{{
alton_requirements_file
}}"
virtualenv
:
"
{{
alton_venv_dir
}}"
state
:
present
extra_args
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}"
become_user
:
"
{{
alton_user
}}"
notify
:
restart alton
-
name
:
c
reate the supervisor wrapper
template
:
>
src
="{{ alton_supervisor_wrapper|
basename }}.j2"
dest
=
"{{ alton_supervisor_wrapper }}"
mode
=0755
-
name
:
C
reate the supervisor wrapper
template
:
src
:
"
{{
alton_supervisor_wrapper
|
basename
}}.j2"
dest
:
"
{{
alton_supervisor_wrapper
}}"
mode
:
"
0755"
sudo_user
:
"
{{
alton_user
}}"
notify
:
restart alton
-
name
:
create a supervisor config
template
:
>
src=alton.conf.j2 dest="{{ supervisor_available_dir }}/alton.conf"
owner="{{ supervisor_user }}"
group="{{ supervisor_user }}"
-
name
:
Create a supervisor config
template
:
src
:
alton.conf.j2
dest
:
"
{{
supervisor_available_dir
}}/alton.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
supervisor_user
}}"
become_user
:
"
{{
supervisor_user
}}"
notify
:
restart alton
-
name
:
e
nable the supervisor config
file
:
>
src
=
"{{ supervisor_available_dir }}/alton.conf"
dest
=
"{{ supervisor_cfg_dir }}/alton.conf"
state
=
link
force
=
yes
mode
=0644
-
name
:
E
nable the supervisor config
file
:
src
:
"
{{
supervisor_available_dir
}}/alton.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/alton.conf"
state
:
link
force
:
yes
mode
:
"
0644"
become_user
:
"
{{
supervisor_user
}}"
when
:
not disable_edx_services
notify
:
restart alton
-
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 alton is started
supervisorctl
:
>
name
=
alton
supervisorctl_path
={{ supervisor_ctl }}
config
={{ supervisor_cfg }}
state
=
started
-
name
:
E
nsure alton is started
supervisorctl
:
name
:
alton
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/alton/tasks/main.yml
View file @
d02435b1
...
...
@@ -21,17 +21,23 @@
#
#
-
name
:
create application user
user
:
>
name="{{ alton_user }}" home="{{ alton_app_dir }}"
createhome=no shell=/bin/false
-
name
:
Create application user
user
:
name
:
"
{{
alton_user
}}"
home
:
"
{{
alton_app_dir
}}"
createhome
:
no
shell
:
/bin/false
-
name
:
create alton user dirs
file
:
>
path="{{ item }}" state=directory
owner="{{ alton_user }}" group="{{ common_web_group }}"
-
name
:
Create alton user dirs
file
:
path
:
"
{{
item
}}"
state
:
directory
owner
:
"
{{
alton_user
}}"
group
:
"
{{
common_web_group
}}"
with_items
:
-
"
{{
alton_app_dir
}}"
-
"
{{
alton_venvs_dir
}}"
-
include
:
deploy.yml tags=deploy
-
include
:
deploy.yml
tags
:
-
deploy
playbooks/roles/alton/tasks/tag_ec2.yml
View file @
d02435b1
...
...
@@ -3,11 +3,12 @@
-
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
:
ec2_tag
:
resource
:
"
{{
ansible_ec2_instance_id
}}"
region
:
"
{{
ansible_ec2_placement_region
}}"
tags
:
"
version:alton"
:
"
{{
alton_source_repo
}}
{{
alton_checkout.after
|truncate(7,True,'')}}"
when
:
alton_checkout.after is defined
...
...
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