Commit ea23dd2c by arbabnazar

rewrite the edxapp main using 3+ parameter tasks

parent 258045a0
...@@ -3,72 +3,71 @@ ...@@ -3,72 +3,71 @@
# - common/tasks/main.yml # - common/tasks/main.yml
--- ---
- name: create application user - name: create application user
user: > user:
name="{{ edxapp_user }}" home="{{ edxapp_app_dir }}" name: "{{ edxapp_user }}"
createhome=no shell=/bin/false home: "{{ edxapp_app_dir }}"
createhome: no
shell: /bin/false
tags: tags:
- install - install
- install:base - install:base
- name: create edxapp user dirs - name: create edxapp user dirs
file: > file:
path="{{ item }}" state=directory path: "{{ item.path }}"
owner="{{ edxapp_user }}" group="{{ common_web_group }}" state: directory
owner: "{{ edxapp_user }}"
group: "{{ common_web_group }}"
mode: "{{ item.mode | default(0755) }}"
with_items: with_items:
- "{{ edxapp_app_dir }}" - { path: "{{ edxapp_app_dir }}" }
# needed for the ansible 1.5 git module # needed for the ansible 1.5 git module
- "{{ edxapp_app_dir }}/.ssh" - { path: "{{ edxapp_app_dir }}/.ssh" }
- "{{ edxapp_venvs_dir }}" - { path: "{{ edxapp_venvs_dir }}" }
- "{{ edxapp_theme_dir }}" - { path: "{{ edxapp_theme_dir }}" }
- "{{ edxapp_staticfile_dir }}" - { path: "{{ edxapp_staticfile_dir }}" }
- "{{ edxapp_course_static_dir }}" - { path: "{{ edxapp_course_static_dir }}" }
- "{{ edxapp_course_data_dir }}" - { path: "{{ edxapp_course_data_dir }}" }
tags: # var should have more permissive permissions than the rest
- install - { path: "{{ edxapp_data_dir }}", mode: "0775" }
- install:base # directory to import the courses from github
- { path: "{{ EDXAPP_GIT_REPO_DIR }}", mode: "0775" }
# var should have more permissive permissions than the rest
- name: create edxapp var dir
file: >
path={{ edxapp_data_dir }} state=directory mode=0775
owner="{{ edxapp_user }}" group="{{ common_web_group }}"
tags: tags:
- install - install
- install:base - install:base
# directory to import the courses from github
- name: create directory to import the courses from github
file: >
path={{ EDXAPP_GIT_REPO_DIR }} state=directory mode=0775
owner="{{ edxapp_user }}" group="{{ common_web_group }}"
# This is a symlink that has to exist because # This is a symlink that has to exist because
# we currently can't override the DATA_DIR var # we currently can't override the DATA_DIR var
# in edx-platform. TODO: This can be removed once # in edx-platform. TODO: This can be removed once
# VPC-122 is closed # VPC-122 is closed
- name: make the course data dir - name: make the course data dir
file: file:
src="{{ edxapp_course_data_dir }}" src: "{{ edxapp_course_data_dir }}"
dest="{{ edxapp_legacy_course_data_dir }}" dest: "{{ edxapp_legacy_course_data_dir }}"
state=link state: link
owner="{{ edxapp_user }}" owner: "{{ edxapp_user }}"
group="{{ common_web_group }}" group: "{{ common_web_group }}"
tags: tags:
- install - install
- install:base - install:base
- name: create edxapp log dir - name: create edxapp log dir
file: > file:
path="{{ edxapp_log_dir }}" state=directory path: "{{ edxapp_log_dir }}"
owner="{{ common_log_user }}" group="{{ common_log_user }}" state: directory
owner: "{{ common_log_user }}"
group: "{{ common_log_user }}"
tags: tags:
- install - install
- install:base - install:base
- name: create web-writable edxapp data dirs - name: create web-writable edxapp data dirs
file: > file:
path="{{ item }}" state=directory path: "{{ item }}"
owner="{{ common_web_user }}" group="{{ edxapp_user }}" state: directory
mode="0775" owner: "{{ common_web_user }}"
group: "{{ edxapp_user }}"
mode: "0775"
with_items: with_items:
- "{{ edxapp_course_data_dir }}" - "{{ edxapp_course_data_dir }}"
- "{{ edxapp_upload_dir }}" - "{{ edxapp_upload_dir }}"
...@@ -79,38 +78,51 @@ ...@@ -79,38 +78,51 @@
# adding chris-lea nodejs repo # adding chris-lea nodejs repo
- name: add ppas for current versions of nodejs - name: add ppas for current versions of nodejs
apt_repository: repo="{{ edxapp_chrislea_ppa }}" apt_repository:
repo: "{{ edxapp_chrislea_ppa }}"
tags: tags:
- install - install
- install:base - install:base
- name: install system packages on which LMS and CMS rely - name: install system packages on which LMS and CMS rely
apt: pkg={{','.join(edxapp_debian_pkgs)}} state=present update_cache=yes apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items: "{{ edxapp_debian_pkgs }}"
tags: tags:
- install - install
- install:base - install:base
- name: set up edxapp .npmrc - name: set up edxapp .npmrc
template: template:
src=.npmrc.j2 dest={{ edxapp_app_dir }}/.npmrc src: .npmrc.j2
owner={{ edxapp_user }} group={{ common_web_group }} dest: "{{ edxapp_app_dir }}/.npmrc"
mode=0600 owner: "{{ edxapp_user }}"
group: "{{ common_web_group }}"
mode: 0600
tags: tags:
- install - install
- install:base - install:base
- name: create log directories for service variants - name: create log directories for service variants
file: > file:
path={{ edxapp_log_dir }}/{{ item }} state=directory path: "{{ edxapp_log_dir }}/{{ item }}"
owner={{ common_log_user }} group={{ common_log_user }} state: directory
mode=0750 owner: "{{ common_log_user }}"
with_items: service_variants_enabled group: "{{ common_log_user }}"
mode: 0750
with_items: "{{ service_variants_enabled }}"
tags: tags:
- install - install
- install:base - install:base
# Set up the python sandbox execution environment # Set up the python sandbox execution environment
- include: python_sandbox_env.yml tags=deploy - include: python_sandbox_env.yml
when: EDXAPP_PYTHON_SANDBOX when: EDXAPP_PYTHON_SANDBOX
tags:
- deploy
- include: deploy.yml tags=deploy - include: deploy.yml
tags:
- deploy
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment