Commit ea873168 by arbabnazar

use the YAML style parameter passing

parent 6e7fb883
......@@ -50,7 +50,7 @@
tags:
- install
- install:base
- name: create edxapp log dir
file:
path: "{{ edxapp_log_dir }}"
......@@ -60,7 +60,7 @@
tags:
- install
- install:base
- name: create web-writable edxapp data dirs
file:
path: "{{ item }}"
......@@ -75,7 +75,7 @@
tags:
- install
- install:base
# adding chris-lea nodejs repo
- name: add ppas for current versions of nodejs
apt_repository:
......@@ -83,7 +83,7 @@
tags:
- install
- install:base
- name: install system packages on which LMS and CMS rely
apt:
name: "{{ item }}"
......@@ -93,7 +93,7 @@
tags:
- install
- install:base
- name: set up edxapp .npmrc
template:
src: .npmrc.j2
......@@ -104,7 +104,7 @@
tags:
- install
- install:base
- name: create log directories for service variants
file:
path: "{{ edxapp_log_dir }}/{{ item }}"
......@@ -116,7 +116,7 @@
tags:
- install
- install:base
# Set up the python sandbox execution environment
- include: python_sandbox_env.yml
when: EDXAPP_PYTHON_SANDBOX
......@@ -124,5 +124,5 @@
- deploy
- include: deploy.yml
tags:
tags:
- deploy
---
# Set the alternatives this way for blas and lapack to work correctly for the
# MITx 6.341x course.
- name: code sandbox | Check which `libblas` to use
# The `libblas.so.3gf` exists only in 12.04
stat: path=/usr/lib/libblas/libblas.so.3gf
stat:
path: /usr/lib/libblas/libblas.so.3gf
register: libblas_file
- name: code sandbox | Use libblas.so.3gf in Ubuntu 12.04
alternatives: name=libblas.so.3gf path=/usr/lib/libblas/libblas.so.3gf
- name: code sandbox | Use libblas.so.3gf in Ubuntu
alternatives:
name: libblas.so.3gf
path: /usr/lib/libblas/libblas.so.3gf
when: libblas_file.stat.exists
- name: code sandbox | Use libblas.so.3 in Ubuntu 14.04
alternatives: name=libblas.so.3 path=/usr/lib/libblas/libblas.so.3
- name: code sandbox | Use libblas.so.3 in Ubuntu
alternatives:
name: libblas.so.3
path: /usr/lib/libblas/libblas.so.3
when: not libblas_file.stat.exists
- name: code sandbox | Check which `liblapac` to use
# The `liblapack.so.3gf` exists only in 12.04
stat: path=/usr/lib/lapack/liblapack.so.3gf
stat:
path: /usr/lib/lapack/liblapack.so.3gf
register: liblapack_file
- name: code sandbox | Use liblapack.so.3gf in Ubuntu 12.04
alternatives: name=liblapack.so.3gf path=/usr/lib/lapack/liblapack.so.3gf
- name: code sandbox | Use liblapack.so.3gf in Ubuntu
alternatives:
name: liblapack.so.3gf
path: /usr/lib/lapack/liblapack.so.3gf
when: liblapack_file.stat.exists
- name: code sandbox | Use liblapack.so.3 in Ubuntu 14.04
alternatives: name=liblapack.so.3 path=/usr/lib/lapack/liblapack.so.3
- name: code sandbox | Use liblapack.so.3 in Ubuntu
alternatives:
name: liblapack.so.3
path: /usr/lib/lapack/liblapack.so.3
when: not liblapack_file.stat.exists
- name: code sandbox | Create edxapp sandbox user
user: name={{ edxapp_sandbox_user }} shell=/bin/false home={{ edxapp_sandbox_venv_dir }}
user:
name: "{{ edxapp_sandbox_user }}"
shell: /bin/false
home: "{{ edxapp_sandbox_venv_dir }}"
tags:
- edxapp-sandbox
- edxapp-sandbox
- name: code sandbox | Install apparmor utils system pkg
apt: pkg=apparmor-utils state=present
apt:
name: apparmor-utils
state: present
tags:
- edxapp-sandbox
- edxapp-sandbox
- name: code sandbox | write out apparmor code sandbox config
template: src=code.sandbox.j2 dest=/etc/apparmor.d/code.sandbox mode=0644 owner=root group=root
template:
src: code.sandbox.j2
dest: /etc/apparmor.d/code.sandbox
mode: 0644
owner: root
group: root
tags:
- edxapp-sandbox
- edxapp-sandbox
- name: code sandbox | write out sandbox user sudoers config
template: src=95-sandbox-sudoer.j2 dest=/etc/sudoers.d/95-{{ edxapp_sandbox_user }} mode=0440 owner=root group=root validate='visudo -c -f %s'
template:
src: 95-sandbox-sudoer.j2
dest: "/etc/sudoers.d/95-{{ edxapp_sandbox_user }}"
mode: 0440
owner: root
group: root
validate: 'visudo -c -f %s'
tags:
- edxapp-sandbox
- edxapp-sandbox
# we boostrap and enable the apparmor service here. in deploy.yml we disable, deploy, then re-enable
# we boostrap and enable the apparmor service here. In deploy.yml we disable, deploy, then re-enable
# so we need to enable it in main.yml
- name: code sandbox | start apparmor service
service: name=apparmor state=started
service:
name: apparmor
state: started
tags:
- edxapp-sandbox
- edxapp-sandbox
- name: code sandbox | (bootstrap) load code sandbox profile
command: apparmor_parser -r /etc/apparmor.d/code.sandbox
tags:
- edxapp-sandbox
- edxapp-sandbox
- name: code sandbox | (bootstrap) put code sandbox into aa-enforce or aa-complain mode depending on EDXAPP_SANDBOX_ENFORCE
command: /usr/sbin/{{ edxapp_aa_command }} /etc/apparmor.d/code.sandbox
tags:
- edxapp-sandbox
- edxapp-sandbox
---
- name: get instance information
action: ec2_facts
- name: tag instance with edx_platform version
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:edx_platform" : "{{ edx_platform_repo }} {{ edxapp_platform_checkout.after|truncate(7,True,'') }}"
when: edxapp_platform_checkout.after is defined
- name: tag instance with edxapp theme version
ec2_tag: resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args:
- name: tag instance with edxapp theme version
ec2_tag:
resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
tags:
"version:edxapp_theme" : "{{ edxapp_theme_source_repo }} {{ edxapp_theme_checkout.after|truncate(7,True,'') }}"
when: edxapp_theme_checkout.after is defined
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