Commit 3446a2fb by arbabnazar

fix ansible 2.x error

parent 13173bff
---
- name: create edxapp configuration dir
- name: Create edxapp configuration dir
file:
path: "{{ EDXAPP_CFG_DIR }}"
state: directory
......@@ -9,7 +9,7 @@
- install
- install:base
- name: copy the template to the desired location
- name: Copy the template to the desired location
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
......@@ -24,7 +24,7 @@
- install
- install:base
- name: install read-only ssh key
- name: Install read-only ssh key
copy:
content: "{{ EDXAPP_GIT_IDENTITY }}"
dest: "{{ edxapp_git_identity }}"
......@@ -36,7 +36,7 @@
- install
- install:base
- name: set git fetch.prune to ignore deleted remote refs
- name: Set git fetch.prune to ignore deleted remote refs
shell: git config --global fetch.prune true
become_user: "{{ edxapp_user }}"
tags:
......@@ -44,7 +44,7 @@
- install:base
# Do A Checkout
- name: checkout edx-platform repo into {{ edxapp_code_dir }}
- name: Checkout edx-platform repo into {{ edxapp_code_dir }}
git_2_0_1:
dest: "{{ edxapp_code_dir }}"
repo: "{{ edx_platform_repo }}"
......@@ -58,7 +58,7 @@
- install
- install:code
- name: git clean after checking out edx-platform
- name: Git clean after checking out edx-platform
shell: cd {{ edxapp_code_dir }} && git clean -xdf
become_user: "{{ edxapp_user }}"
tags:
......@@ -71,7 +71,7 @@
# To enable Stanford theming, point edxapp_theme_source_repo
# (yes, lowercase) to a Stanford-style theme and set
# edxapp_theme_name (again, lowercase) to its name.
- name: checkout Stanford-style theme
- name: Checkout Stanford-style theme
git_2_0_1:
dest: "{{ edxapp_app_dir }}/themes/{{ edxapp_theme_name }}"
repo: "{{ edxapp_theme_source_repo }}"
......@@ -90,7 +90,7 @@
# EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO to your theme repo, and set
# EDXAPP_COMPREHENSIVE_THEME_DIR to the directory you want to check
# out to.
- name: checkout comprehensive theme
- name: Checkout comprehensive theme
git_2_0_1:
dest: "{{ EDXAPP_COMPREHENSIVE_THEME_DIR }}"
repo: "{{ EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO }}"
......@@ -197,7 +197,7 @@
# Private requriements require a ssh key to install, use the same key as the private key for edx-platform
# If EDXAPP_INSTALL_PRIVATE_REQUIREMENTS is set to true EDXAPP_USE_GIT_IDENTITY must also be true
- name: install python private requirements
- name: Install python private requirements
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
......@@ -215,7 +215,7 @@
- install:app-requirements
# Install any custom extra requirements if defined in EDXAPP_EXTRA_REQUIREMENTS.
- name: install python extra requirements
- name: Install python extra requirements
pip:
name: "{{ item.name }}"
version: "{{ item.version|default(omit) }}"
......@@ -230,7 +230,7 @@
# If using CAS and you have a function for mapping attributes, install
# the module here. The next few tasks set up the python code sandbox
- name: install CAS attribute module
- name: Install CAS attribute module
pip:
name: "{{ EDXAPP_CAS_ATTRIBUTE_PACKAGE }}"
virtualenv: "{{ edxapp_venv_dir }}"
......@@ -243,7 +243,7 @@
- install:app-requirements
# Install the sandbox python modules into {{ edxapp_venv_dir }}
- name: install sandbox requirements into regular venv
- name: Install sandbox requirements into regular venv
# Need to use shell rather than pip so that we can maintain the context of our current working directory; some
# requirements are pathed relative to the edx-platform repo. Using the pip from inside the virtual environment implicitly
# installs everything into that virtual environment.
......@@ -264,7 +264,7 @@
# need to disable this profile, otherwise the pip inside the sandbox venv has no permissions
# to install anything
- name: code sandbox | put sandbox apparmor profile in complain mode
- name: Code sandbox | put sandbox apparmor profile in complain mode
command: /usr/sbin/aa-complain /etc/apparmor.d/code.sandbox
when: EDXAPP_PYTHON_SANDBOX
tags:
......@@ -272,7 +272,7 @@
- install
- install:app-requirements
- name: code sandbox | Install base sandbox requirements and create sandbox virtualenv
- name: Code sandbox | Install base sandbox requirements and create sandbox virtualenv
pip:
requirements: "{{ sandbox_base_requirements }}"
virtualenv: "{{ edxapp_sandbox_venv_dir }}"
......@@ -285,7 +285,7 @@
- install
- install:app-requirements
- name: code sandbox | Install sandbox requirements into sandbox venv
- name: Code sandbox | Install sandbox requirements into sandbox venv
shell: >
{{ edxapp_sandbox_venv_dir }}/bin/pip install -i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w -r {{ item }}
chdir={{ edxapp_code_dir }}
......@@ -301,7 +301,7 @@
- install
- install:app-requirements
- name: code sandbox | put code sandbox into aa-enforce or aa-complain mode, depending on EDXAPP_SANDBOX_ENFORCE
- name: Code sandbox | 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
when: EDXAPP_PYTHON_SANDBOX
tags:
......@@ -309,7 +309,7 @@
- install
- install:app-requirements
- name: compiling all py files in the edx-platform repo
- name: Compiling all py files in the edx-platform repo
shell: "{{ edxapp_venv_bin }}/python -m compileall -q -x .git/.* {{ edxapp_code_dir }}"
become_user: "{{ edxapp_user }}"
tags:
......@@ -319,7 +319,7 @@
# alternative would be to give {{ common_web_user }} read access
# to the virtualenv but that permission change will require
# root access.
- name: give other read permissions to the virtualenv
- name: Give other read permissions to the virtualenv
file:
path: "{{ edxapp_venv_dir }}"
state: directory
......@@ -342,7 +342,7 @@
# the services if any of the configurations
# have changed.
- name: update supervisor configuration
- name: Update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update
become_user: "{{ supervisor_service_user }}"
......@@ -351,7 +351,7 @@
tags:
- manage
- name: ensure edxapp has started
- name: Ensure edxapp has started
supervisorctl:
name: "edxapp:"
supervisorctl_path: "{{ supervisor_ctl }}"
......@@ -362,7 +362,7 @@
tags:
- manage
- name: ensure edxapp_workers has started
- name: Ensure edxapp_workers has started
supervisorctl:
name: "edxapp_worker:"
supervisorctl_path: "{{ supervisor_ctl }}"
......@@ -373,7 +373,7 @@
tags:
- manage
- name: create symlinks from the venv bin dir and repo dir
- name: Create symlinks from the venv bin dir and repo dir
file:
src: "{{ item }}"
dest: "{{ COMMON_BIN_DIR }}/{{ (item | basename).split('.', 1) | first }}.edxapp"
......@@ -387,7 +387,7 @@
- install
- install:configuration
- name: remove read-only ssh key
- name: Remove read-only ssh key
file:
path: "{{ edxapp_git_identity }}"
state: absent
......@@ -397,9 +397,10 @@
- install:configuration
- install:code
- include: tag_ec2.yml tags=deploy
- include: tag_ec2.yml
when: COMMON_TAG_EC2_INSTANCE
tags:
- deploy
- remove
- aws
......
......@@ -2,7 +2,7 @@
# - group_vars/all
# - common/tasks/main.yml
---
- name: create application user
- name: Create application user
user:
name: "{{ edxapp_user }}"
home: "{{ edxapp_app_dir }}"
......@@ -12,7 +12,7 @@
- install
- install:base
- name: create edxapp user dirs
- name: Create edxapp user dirs
file:
path: "{{ item.path }}"
state: directory
......@@ -40,7 +40,7 @@
# we currently can't override the DATA_DIR var
# in edx-platform. TODO: This can be removed once
# VPC-122 is closed
- name: make the course data dir
- name: Make the course data dir
file:
src: "{{ edxapp_course_data_dir }}"
dest: "{{ edxapp_legacy_course_data_dir }}"
......@@ -51,7 +51,7 @@
- install
- install:base
- name: create edxapp log dir
- name: Create edxapp log dir
file:
path: "{{ edxapp_log_dir }}"
state: directory
......@@ -61,7 +61,7 @@
- install
- install:base
- name: create web-writable edxapp data dirs
- name: Create web-writable edxapp data dirs
file:
path: "{{ item }}"
state: directory
......@@ -77,14 +77,14 @@
- install:base
# 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 }}"
tags:
- install
- install:base
- name: install system packages on which LMS and CMS rely
- name: Install system packages on which LMS and CMS rely
apt:
name: "{{ item }}"
state: present
......@@ -94,7 +94,7 @@
- install
- install:base
- name: set up edxapp .npmrc
- name: Set up edxapp .npmrc
template:
src: .npmrc.j2
dest: "{{ edxapp_app_dir }}/.npmrc"
......@@ -105,7 +105,7 @@
- install
- install:base
- name: create log directories for service variants
- name: Create log directories for service variants
file:
path: "{{ edxapp_log_dir }}/{{ item }}"
state: directory
......
---
# 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
- name: Code sandbox | Check which `libblas` to use
stat:
path: /usr/lib/libblas/libblas.so.3gf
register: libblas_file
- name: code sandbox | Use libblas.so.3gf in Ubuntu
- 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
- 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
- name: Code sandbox | Check which `liblapac` to use
stat:
path: /usr/lib/lapack/liblapack.so.3gf
register: liblapack_file
- name: code sandbox | Use liblapack.so.3gf in Ubuntu
- 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
- 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
- name: Code sandbox | Create edxapp sandbox user
user:
name: "{{ edxapp_sandbox_user }}"
shell: /bin/false
......@@ -44,14 +44,14 @@
tags:
- edxapp-sandbox
- name: code sandbox | Install apparmor utils system pkg
- name: Code sandbox | Install apparmor utils system pkg
apt:
name: apparmor-utils
state: present
tags:
- edxapp-sandbox
- name: code sandbox | write out apparmor code sandbox config
- name: Code sandbox | write out apparmor code sandbox config
template:
src: code.sandbox.j2
dest: /etc/apparmor.d/code.sandbox
......@@ -61,7 +61,7 @@
tags:
- edxapp-sandbox
- name: code sandbox | write out sandbox user sudoers config
- name: Code sandbox | write out sandbox user sudoers config
template:
src: 95-sandbox-sudoer.j2
dest: "/etc/sudoers.d/95-{{ edxapp_sandbox_user }}"
......@@ -74,19 +74,19 @@
# 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
- name: Code sandbox | start apparmor service
service:
name: apparmor
state: started
tags:
- edxapp-sandbox
- name: code sandbox | (bootstrap) load code sandbox profile
- name: Code sandbox | (bootstrap) load code sandbox profile
command: apparmor_parser -r /etc/apparmor.d/code.sandbox
tags:
- edxapp-sandbox
- name: code sandbox | (bootstrap) put code sandbox into aa-enforce or aa-complain mode depending on EDXAPP_SANDBOX_ENFORCE
- 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
---
- name: create application and auth config
- name: Create application and auth config
template:
src: "{{ item[0] }}.{{ item[1] }}.json.j2"
dest: "{{ edxapp_app_dir }}/{{ item[0] }}.{{ item[1] }}.json"
......@@ -12,7 +12,7 @@
- install:configuration
- edxapp_cfg
- name: create auth and application yaml config
- name: Create auth and application yaml config
template:
src: "{{ item[0] }}.{{ item[1] }}.yaml.j2"
dest: "{{ EDXAPP_CFG_DIR }}/{{ item[0] }}.{{ item[1] }}.yaml"
......@@ -26,7 +26,7 @@
- edxapp_cfg
# write the supervisor scripts for the service variants
- name: "writing {{ item }} supervisor script"
- name: "Writing {{ item }} supervisor script"
template:
src: "{{ item }}.conf.j2"
dest: "{{ supervisor_available_dir }}/{{ item }}.conf"
......@@ -39,7 +39,7 @@
- install:configuration
# write the supervisor script for edxapp and celery workers
- name: writing edxapp and celery supervisor scripts
- name: Writing edxapp and celery supervisor scripts
template:
src: "{{ item }}.j2"
dest: "{{ supervisor_available_dir }}/{{ item }}"
......@@ -53,7 +53,7 @@
- install
- install:configuration
- name: add gunicorn configuration files
- name: Add gunicorn configuration files
template:
src: "{{ item }}_gunicorn.py.j2"
dest: "{{ edxapp_app_dir }}/{{ item }}_gunicorn.py"
......@@ -64,7 +64,7 @@
- install:configuration
# Enable the supervisor jobs
- name: "enable {{ item }} supervisor script"
- name: "Enable {{ item }} supervisor script"
file:
src: "{{ supervisor_available_dir }}/{{ item }}.conf"
dest: "{{ supervisor_cfg_dir }}/{{ item }}.conf"
......@@ -77,7 +77,7 @@
- install
- install:configuration
- name: enable edxapp supervisor script
- name: Enable edxapp supervisor script
file:
src: "{{ supervisor_available_dir }}/edxapp.conf"
dest: "{{ supervisor_cfg_dir }}/edxapp.conf"
......@@ -89,7 +89,7 @@
- install
- install:configuration
- name: enable celery worker supervisor script
- name: Enable celery worker supervisor script
file:
src: "{{ supervisor_available_dir }}/workers.conf"
dest: "{{ supervisor_cfg_dir }}/workers.conf"
......@@ -101,7 +101,7 @@
- install
- install:configuration
- name: create helper scripts for managing edxapp
- name: Create helper scripts for managing edxapp
template:
src: "edx/bin/{{ item[0] }}-{{ item[1] }}.j2"
dest: "{{ COMMON_BIN_DIR }}/{{ item[0] }}-{{ item[1] }}"
......@@ -115,7 +115,7 @@
- install:configuration
# migrate when the migrate user is overridden in extra vars
- name: migrate
- name: Migrate
command: "{{ COMMON_BIN_DIR }}/edxapp-migrate-{{ item }}"
when: migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS and item != "lms-preview"
environment:
......@@ -145,7 +145,7 @@
- assets
# Gather assets using paver if possible
- name: "gather {{ item }} static assets with paver"
- name: "Gather {{ item }} static assets with paver"
command: "{{ COMMON_BIN_DIR }}/edxapp-update-assets-{{ item }}"
when: celery_worker is not defined and not devstack and item != "lms-preview"
with_items: "{{ service_variants_enabled }}"
......
---
- name: get instance information
- name: Get instance information
action: ec2_facts
- name: tag instance with edx_platform version
- name: Tag instance with edx_platform version
ec2_tag:
resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
......@@ -10,7 +10,7 @@
"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
- name: Tag instance with edxapp theme version
ec2_tag:
resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
......
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