Commit 6d280c2f by arbabnazar

use YAML syntax

parent 1ab59651
......@@ -15,9 +15,9 @@
#
#
- name: restart xsy
supervisorctl: >
name=xsy
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=restarted
supervisorctl:
name: xsy
supervisorctl_path: "{{ supervisor_ctl }}"
config: "{{ supervisor_cfg }}"
state: restarted
when: not disable_edx_services
......@@ -20,84 +20,94 @@
# Example play:
#
#
- name: Create application user
user:
name: "{{ xsy_user }}"
home: "{{ xsy_app_dir }}"
createhome: no
shell: /bin/false
- name: create application user
user: >
name="{{ xsy_user }}" home="{{ xsy_app_dir }}"
createhome=no shell=/bin/false
- name: create xsy user dirs
file: >
path="{{ item }}" state=directory
owner="{{ xsy_user }}" group="{{ common_web_group }}"
- name: Create xsy user dirs
file:
path: "{{ item }}"
state: directory
owner: "{{ xsy_user }}"
group: "{{ common_web_group }}"
with_items:
- "{{ xsy_app_dir }}"
- "{{ xsy_venvs_dir }}"
- name: setup the xsy env
template: >
src="xsy_env.j2" dest="{{ xsy_app_dir }}/xsy_env"
owner="{{ xsy_user }}" group="{{ common_web_user }}"
mode=0644
- name: Setup the xsy env
template:
src: "xsy_env.j2"
dest: "{{ xsy_app_dir }}/xsy_env"
owner: "{{ xsy_user }}"
group: "{{ common_web_user }}"
mode: "0644"
notify: restart xsy
- name: checkout the code
git_2_0_1: >
dest="{{ xsy_code_dir }}" repo="{{ xsy_source_repo }}"
version="{{ xsy_version }}" accept_hostkey=yes
- name: Checkout the code
git_2_0_1:
dest: "{{ xsy_code_dir }}"
repo: "{{ xsy_source_repo }}"
version: "{{ xsy_version }}"
accept_hostkey: yes
become_user: "{{ xsy_user }}"
register: xsy_checkout
notify: restart xsy
- name: install the requirements
pip: >
requirements="{{ xsy_requirements_file }}"
virtualenv="{{ xsy_venv_dir }}"
state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
- name: Install the requirements
pip:
requirements: "{{ xsy_requirements_file }}"
virtualenv: "{{ xsy_venv_dir }}"
state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
become_user: "{{ xsy_user }}"
notify: restart xsy
- name: create the supervisor wrapper
template: >
src="{{ xsy_supervisor_wrapper|basename }}.j2"
dest="{{ xsy_supervisor_wrapper }}"
mode=0755
- name: Create the supervisor wrapper
template:
src: "{{ xsy_supervisor_wrapper | basename }}.j2"
dest: "{{ xsy_supervisor_wrapper }}"
mode: "0755"
become_user: "{{ xsy_user }}"
notify: restart xsy
- name: create a supervisor config
template: >
src=xsy.conf.j2 dest="{{ supervisor_available_dir }}/xsy.conf"
owner="{{ supervisor_user }}"
group="{{ supervisor_user }}"
- name: Create a supervisor config
template:
src: "xsy.conf.j2"
dest: "{{ supervisor_available_dir }}/xsy.conf"
owner: "{{ supervisor_user }}"
group: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
notify: restart xsy
- name: enable the supervisor config
file: >
src="{{ supervisor_available_dir }}/xsy.conf"
dest="{{ supervisor_cfg_dir }}/xsy.conf"
state=link
force=yes
mode=0644
- name: Enable the supervisor config
file:
src: "{{ supervisor_available_dir }}/xsy.conf"
dest: "{{ supervisor_cfg_dir }}/xsy.conf"
state: link
force: yes
mode: "0644"
become_user: "{{ supervisor_user }}"
when: not disable_edx_services
notify: restart xsy
- name: update supervisor configuration
- name: Update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update
changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services
- name: ensure xsy is started
supervisorctl: >
name=xsy
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=started
- name: Ensure xsy is started
supervisorctl:
name: xsy
supervisorctl_path: "{{ supervisor_ctl }}"
config: "{{ supervisor_cfg }}"
state: started
when: not disable_edx_services
- include: tag_ec2.yml tags=deploy
- include: tag_ec2.yml
when: COMMON_TAG_EC2_INSTANCE
tags:
- deploy
......@@ -3,13 +3,14 @@
- name: get instance information
action: ec2_facts
tags:
- deploy
- deploy
- name: tag instance
ec2_tag: resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args:
tags:
"version:xsy" : "{{ xsy_source_repo }} {{ xsy_checkout.after |truncate(7,True,'')}}"
- name: Tag instance
ec2_tag:
resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}"
tags:
"version:xsy" : "{{ xsy_source_repo }} {{ xsy_checkout.after |truncate(7,True,'')}}"
when: xsy_checkout.after is defined
tags:
- deploy
- 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