Commit b8681b20 by arbabnazar

using YAML syntax to rewrite the ansible tasks

parent 92acf889
......@@ -49,12 +49,12 @@
# example we were seeing it defaulting to `root` for both.
# The item that is a blank string("") ensures the ownership
# of the home directory is always correct before proceeding.
- name: create edx_service app, venv, data, and staticfiles dirs
file: >
path="{{ edx_service_home }}/{{ item }}"
state=directory
owner="{{ edx_service_name }}"
group="{{ common_web_group }}"
- name: Create edx_service app, venv, data, and staticfiles dirs
file:
path: "{{ edx_service_home }}/{{ item }}"
state: directory
owner: "{{ edx_service_name }}"
group: "{{ common_web_group }}"
with_items:
- ""
- "venvs"
......@@ -64,73 +64,74 @@
- install
- install:base
- name: create /edx/var and /edx/etc dirs
file: >
path="{{ item }}/{{ edx_service_name }}"
state=directory
owner={{ edx_service_user }}
group={{ common_web_group }}
mode=0755
- name: Create /edx/var and /edx/etc dirs
file:
path: "{{ item }}/{{ edx_service_name }}"
state: directory
owner: "{{ edx_service_user }}"
group: "{{ common_web_group }}"
mode: "0755"
with_items:
- /edx/var
- /edx/etc
- "/edx/var"
- "/edx/etc"
tags:
- install
- install:base
- name: create edx_service log dir
file: >
path="{{ item }}"
state=directory
owner="syslog"
group="syslog"
- name: Create edx_service log dir
file:
path: "{{ item }}"
state: directory
owner: "syslog"
group: "syslog"
with_items:
- "{{ COMMON_LOG_DIR }}/{{ edx_service_name }}"
tags:
- install
- install:base
- name: write out app config file
template: >
src=config.yml.j2
dest={{ COMMON_CFG_DIR }}/{{ edx_service_name }}.yml
mode=0644
- name: Write out app config file
template:
src: "config.yml.j2"
dest: "{{ COMMON_CFG_DIR }}/{{ edx_service_name }}.yml"
mode: "0644"
when: edx_service_config is defined
tags:
- install
- install:configuration
- name: install a bunch of system packages on which edx_service relies
- name: Install a bunch of system packages on which edx_service relies
apt:
pkg: "{{ item }}"
name: "{{ item }}"
state: present
update_cache: true
cache_valid_time: 3600
with_items: edx_service_packages.debian
with_items: "{{ edx_service_packages.debian }}"
when: ansible_distribution in common_debian_variants
tags:
- install
- install:system-requirements
- name: install a bunch of system packages on which edx_service relies
yum: pkg={{ item }} state=present
with_items: edx_service_name.redhat
- name: Install a bunch of system packages on which edx_service relies
yum:
name: "{{ item }}"
state: present
with_items: "{{ edx_service_packages.redhat }}"
when: ansible_distribution in common_redhat_variants
tags:
- install
- install:system-requirements
- name: get instance information
- name: Get instance information
action: ec2_facts
tags:
- to-remove
#old syntax - should be fixed
- name: tag instance
- name: Tag instance
ec2_tag_local: resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args:
tags:
- Name: version:{{edx_service_name}}
- Name: version:{{ edx_service_name }}
Value: "{{ item.0.DOMAIN }}/{{ item.0.PATH }}/{{ item.0.REPO }} {{ item.1.after |truncate(7,True,'') }}"
when: item.1.after is defined and COMMON_TAG_EC2_INSTANCE and edx_service_repos is defined
with_together:
......
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