YAML style parameter passing

parent 73545e9a
---
- name: restart flower
supervisorctl: >
state=restarted
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
name="{{ FLOWER_USER }}"
sudo_user: "{{supervisor_service_user }}"
supervisorctl:
state: restarted
supervisorctl_path: "{{ supervisor_ctl }}"
config: "{{ supervisor_cfg }}"
name: "{{ FLOWER_USER }}"
sudo_user: "{{ supervisor_service_user }}"
---
- name: create application user
user: >
name="{{ FLOWER_USER }}" home="{{ flower_app_dir }}"
createhome=no shell=/bin/false
- name: Create application user
user:
name: "{{ FLOWER_USER }}"
home: "{{ flower_app_dir }}"
createhome: no
shell: /bin/false
notify:
- "restart flower"
- restart flower
- name: create flower user dirs
file: >
path="{{ item }}" state=directory
owner="{{ FLOWER_USER }}" group="{{ common_web_group }}"
- name: Create flower user dirs
file:
path: "{{ item }}"
state: directory
owner: "{{ FLOWER_USER }}"
group: "{{ common_web_group }}"
notify:
- "restart flower"
- restart flower
with_items:
- "{{ flower_app_dir }}"
- "{{ flower_data_dir }}"
- "{{ flower_venv_dir }}"
- "{{ flower_log_dir }}"
- name: create flower environment script
template: >
src=edx/app/flower/flower_env.j2
dest={{ flower_app_dir }}/flower_env
owner={{ FLOWER_USER }} group={{ common_web_group }}
mode=0640
notify:
- "restart flower"
- name: create flower configuration file
template: >
src=edx/app/flower/flowerconfig.py.j2
dest={{ flower_conf_dir }}/flowerconfig.py
owner={{ FLOWER_USER }} group={{ common_web_group }}
mode=0640
- name: Create flower environment script and configuration file
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ FLOWER_USER }}"
group: "{{ common_web_group }}"
mode: 0640
notify:
- "restart flower"
- restart flower
with_items:
- { src: 'edx/app/flower/flower_env.j2', dest: '{{ flower_app_dir }}/flower_env' }
- { src: 'edx/app/flower/flowerconfig.py.j2', dest: '{{ flower_conf_dir }}/flowerconfig.py' }
- name: create virtualenv and install Python requirements
pip: >
name="{{ item }}"
virtualenv="{{ flower_venv_dir }}"
state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
- name: Create virtualenv and install Python requirements
pip:
name: "{{ item }}"
virtualenv: "{{ flower_venv_dir }}"
state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ FLOWER_USER }}"
environment: "{{ flower_environment }}"
with_items: "flower_python_reqs"
with_items: "{{ flower_python_reqs }}"
notify:
- "restart flower"
- restart flower
- name: create supervisor configuration
template: >
src=edx/app/supervisor/conf.d.available/flower.conf.j2
dest={{ supervisor_available_dir }}/{{ FLOWER_USER }}.conf
owner={{ supervisor_user }}
group={{ supervisor_user }}
- name: Create supervisor configuration
template:
src: "edx/app/supervisor/conf.d.available/flower.conf.j2"
dest: "{{ supervisor_available_dir }}/{{ FLOWER_USER }}.conf"
owner: "{{ supervisor_user }}"
group: "{{ supervisor_user }}"
sudo_user: "{{ supervisor_user }}"
notify:
- "restart flower"
- restart flower
- name: enable supervisor configuration
file: >
src={{ supervisor_available_dir }}/{{ FLOWER_USER }}.conf
dest={{ supervisor_cfg_dir }}/{{ FLOWER_USER }}.conf
state=link
force=yes
- name: Enable supervisor configuration
file:
src: "{{ supervisor_available_dir }}/{{ FLOWER_USER }}.conf"
dest: "{{ supervisor_cfg_dir }}/{{ FLOWER_USER }}.conf"
state: link
force: yes
sudo_user: "{{ supervisor_user }}"
notify:
- "restart flower"
- restart flower
- name: update supervisor configuration
- name: Update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update
sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
notify:
- "restart flower"
- restart flower
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