Commit ea873168 by arbabnazar

use the YAML style parameter passing

parent 6e7fb883
---
# 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
- name: code sandbox | Install apparmor utils system pkg
apt: pkg=apparmor-utils state=present
apt:
name: apparmor-utils
state: present
tags:
- 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
- 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
# 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
......
---
- 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:
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