Commit 941a72e7 by arbabnazar

write ansible tasks with YAML syntax

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