Commit 8dba80de by Arbab Nazar Committed by GitHub

Merge pull request #3142 from edx/arbab/apache-rewrite

write ansible tasks with YAML syntax
parents 27512714 941a72e7
--- ---
- name: restart apache - name: restart apache
service: name=apache2 state=restarted service:
tags: deploy name: apache2
state: restarted
tags:
- deploy
# Installs apache and runs the lms wsgi by default # Installs apache and runs the lms wsgi by default
--- ---
- name: Installs apache and mod_wsgi from apt - name: Installs apache and mod_wsgi from apt
apt: pkg={{ item }} install_recommends=no state=present update_cache=yes apt:
name: "{{ item }}"
install_recommends: no
state: present
update_cache: yes
with_items: with_items:
- apache2 - apache2
- libapache2-mod-wsgi - libapache2-mod-wsgi
notify: restart apache notify: restart apache
- name: disables default site - name: Disables default site
command: a2dissite 000-default file:
path: /etc/apache2/sites-enabled/000-default
state: absent
notify: restart apache notify: restart apache
- name: rewrite apache ports conf - name: Rewrite apache ports conf
template: dest=/etc/apache2/ports.conf src=ports.conf.j2 owner=root group=root template:
src: ports.conf.j2
dest: /etc/apache2/ports.conf
owner: root
group: root
notify: restart apache notify: restart apache
- debug: msg={{ apache_sites }} - debug:
msg: "{{ apache_sites }}"
- name: Copying apache configs for {{ apache_sites }} - name: "Copying apache configs for {{ apache_sites }}"
template: > template:
src={{ apache_template_dir }}/{{ item }}.j2 src: "{{ item }}.j2"
dest=/etc/apache2/sites-available/{{ item }} dest: "/etc/apache2/sites-available/{{ item }}"
owner=root group={{ common_web_user }} mode=0640 owner: root
group: "{{ common_web_user }}"
mode: "0640"
notify: restart apache notify: restart apache
with_items: apache_sites with_items: "{{ apache_sites }}"
- name: Creating apache2 config links for {{ apache_sites }} - name: "Creating apache2 config links for {{ apache_sites }}"
file: > file:
src=/etc/apache2/sites-available/{{ item }} src: "/etc/apache2/sites-available/{{ item }}"
dest=/etc/apache2/sites-enabled/{{ item }} dest: "/etc/apache2/sites-enabled/{{ item }}"
state=link owner=root group=root state: link
owner: root
group: root
notify: restart apache notify: restart apache
with_items: apache_sites with_items: "{{ apache_sites }}"
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