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
94ef4e8c
Unverified
Commit
94ef4e8c
authored
Jun 02, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the YAML style parameter passing
parent
fe5d5569
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
65 deletions
+82
-65
playbooks/roles/forum/handlers/main.yml
+5
-5
playbooks/roles/forum/tasks/deploy.yml
+37
-30
playbooks/roles/forum/tasks/main.yml
+26
-21
playbooks/roles/forum/tasks/tag_ec2.yml
+4
-4
playbooks/roles/forum/tasks/test.yml
+10
-5
No files found.
playbooks/roles/forum/handlers/main.yml
View file @
94ef4e8c
---
-
name
:
restart the forum service
supervisorctl
:
>
name
=
forum
supervisorctl_path
={{ supervisor_ctl }}
config
={{ supervisor_cfg }}
state
=
restarted
supervisorctl
:
name
:
forum
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
restarted
when
:
forum_installed is defined and not disable_edx_services
playbooks/roles/forum/tasks/deploy.yml
View file @
94ef4e8c
---
-
name
:
create the supervisor config
template
:
>
src=forum.conf.j2 dest={{ supervisor_available_dir }}/forum.conf
owner={{ supervisor_user }}
group={{ supervisor_user }}
mode=0644
template
:
src
:
forum.conf.j2
dest
:
"
{{
supervisor_available_dir
}}/forum.conf"
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
supervisor_user
}}"
mode
:
0644
sudo_user
:
"
{{
supervisor_user
}}"
register
:
forum_supervisor
tags
:
...
...
@@ -13,13 +13,13 @@
-
install:configuration
-
name
:
enable the supervisor config
file
:
>
src
={{ supervisor_available_dir }}/forum.conf
dest
={{ supervisor_cfg_dir }}/forum.conf
owner
={{ supervisor_user }}
state
=
link
force
=
yes
mode
=
0644
file
:
src
:
"
{{
supervisor_available_dir
}}/forum.conf"
dest
:
"
{{
supervisor_cfg_dir
}}/forum.conf"
owner
:
"
{{
supervisor_user
}}"
state
:
link
force
:
yes
mode
:
0644
sudo_user
:
"
{{
supervisor_user
}}"
when
:
not disable_edx_services
register
:
forum_supervisor
...
...
@@ -28,20 +28,22 @@
-
install:configuration
-
name
:
create the supervisor wrapper
template
:
>
src
={{ forum_supervisor_wrapper|basename }}.j2
dest
={{ forum_supervisor_wrapper }}
mode
=
0755
template
:
src
:
"
{{
forum_supervisor_wrapper|basename
}}.j2"
dest
:
"
{{
forum_supervisor_wrapper
}}"
mode
:
0755
sudo_user
:
"
{{
forum_user
}}"
notify
:
restart the forum service
tags
:
-
install
-
install:configuration
-
name
:
git checkout forum repo into {{ forum_code_dir }}
git_2_0_1
:
>
dest={{ forum_code_dir }} repo={{ forum_source_repo }} version={{ forum_version }}
accept_hostkey=yes
-
name
:
git checkout forum repo into {{ forum_code_dir }}
git_2_0_1
:
dest
:
"
{{
forum_code_dir
}}"
repo
:
"
{{
forum_source_repo
}}"
version
:
"
{{
forum_version
}}"
accept_hostkey
:
yes
sudo_user
:
"
{{
forum_user
}}"
register
:
forum_checkout
notify
:
restart the forum service
...
...
@@ -50,7 +52,7 @@
-
install:code
-
name
:
install comments service bundle
shell
:
bundle install --deployment --path {{ forum_gem_root }} chdir={{ forum_code_dir }}
shell
:
"
bundle
install
--deployment
--path
{{
forum_gem_root
}}
chdir={{
forum_code_dir
}}"
sudo_user
:
"
{{
forum_user
}}"
environment
:
"
{{
forum_environment
}}"
notify
:
restart the forum service
...
...
@@ -73,18 +75,23 @@
-
manage:update
-
name
:
ensure forum is started
supervisorctl
:
>
name
=
forum
supervisorctl_path
={{ supervisor_ctl }}
config
={{ supervisor_cfg }}
state
=
started
supervisorctl
:
name
:
forum
supervisorctl_path
:
"
{{
supervisor_ctl
}}"
config
:
"
{{
supervisor_cfg
}}"
state
:
started
when
:
not disable_edx_services
tags
:
-
manage
-
include
:
test.yml tags=deploy
-
include
:
test.yml
tags
:
-
deploy
-
include
:
tag_ec2.yml
tags=deploy
-
include
:
tag_ec2.yml
when
:
COMMON_TAG_EC2_INSTANCE
tags
:
-
deploy
-
set_fact
:
forum_installed=true
-
set_fact
:
forum_installed
:
true
playbooks/roles/forum/tasks/main.yml
View file @
94ef4e8c
---
# forum
#
# Dependencies:
...
...
@@ -22,12 +21,12 @@
# - forum
-
name
:
create application user
user
:
>
name
=
"{{ forum_user }}"
home
=
"{{ forum_app_dir }}"
createhome
=
yes
shell
=
/bin/false
generate_ssh_key
=
yes
user
:
name
:
"
{{
forum_user
}}"
home
:
"
{{
forum_app_dir
}}"
createhome
:
yes
shell
:
/bin/false
generate_ssh_key
:
yes
notify
:
restart the forum service
tags
:
-
install
...
...
@@ -35,21 +34,23 @@
# Ensure the directory is accessible to the web service
-
name
:
set forum app dir permissions
file
:
>
path
=
"{{ forum_app_dir }}"
state
=
directory
owner
=
"{{ forum_user }}"
group
=
"{{ common_web_group }}"
file
:
path
:
"
{{
forum_app_dir
}}"
state
:
directory
owner
:
"
{{
forum_user
}}"
group
:
"
{{
common_web_group
}}"
notify
:
restart the forum service
tags
:
-
install
-
install:base
-
name
:
setup the forum env
template
:
>
src=forum_env.j2 dest={{ forum_app_dir }}/forum_env
owner={{ forum_user }} group={{ common_web_user }}
mode=0644
template
:
src
:
forum_env.j2
dest
:
"
{{
forum_app_dir
}}/forum_env"
owner
:
"
{{
forum_user
}}"
group
:
"
{{
common_web_user
}}"
mode
:
0644
notify
:
-
restart the forum service
tags
:
...
...
@@ -57,12 +58,16 @@
-
install:base
-
name
:
create {{ forum_data_dir }}
file
:
>
path={{ forum_data_dir }} state=directory
owner="{{ common_web_user }}" group="{{ common_web_group }}"
mode=0777
file
:
path
:
"
{{
forum_data_dir
}}"
state
:
directory
owner
:
"
{{
common_web_user
}}"
group
:
"
{{
common_web_group
}}"
mode
:
0777
tags
:
-
install
-
install:base
-
include
:
deploy.yml tags=deploy
-
include
:
deploy.yml
tags
:
-
deploy
playbooks/roles/forum/tasks/tag_ec2.yml
View file @
94ef4e8c
---
-
name
:
get instance information
action
:
ec2_facts
-
name
:
tag instance
ec2_tag
:
resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args
:
tags
:
ec2_tag
:
resource
:
"
{{
ansible_ec2_instance_id
}}"
region
:
"
{{
ansible_ec2_placement_region
}}"
tags
:
"
version:forum"
:
"
{{
forum_source_repo
}}
{{
forum_checkout.after|truncate(7,True,'')
}}"
when
:
forum_checkout.after is defined
playbooks/roles/forum/tasks/test.yml
View file @
94ef4e8c
---
-
name
:
test that the required service are listening
wait_for
:
port={{ item.port }} host={{ item.host }} timeout=30
with_items
:
forum_services
wait_for
:
port
:
"
{{
item.port
}}"
host
:
"
{{
item.host
}}"
timeout
:
30
with_items
:
"
{{
forum_services
}}"
when
:
not disable_edx_services
-
name
:
test that mongo replica set members are listing
wait_for
:
port={{ FORUM_MONGO_PORT }} host={{ item }} timeout=30
with_items
:
FORUM_MONGO_HOSTS
wait_for
:
port
:
"
{{
FORUM_MONGO_PORT
}}"
host
:
"
{{
item
}}"
timeout
:
30
with_items
:
"
{{
FORUM_MONGO_HOSTS
}}"
when
:
not disable_edx_services
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