Browse Source

apache2 roles

services
Andrea Cimbalo 8 years ago
parent
commit
7e51499c68
5 changed files with 25 additions and 11 deletions
  1. +8
    -0
      blogs.yaml
  2. +13
    -0
      roles/apache2/handlers/main.yaml
  3. +2
    -9
      roles/apache2/tasks/main.yaml
  4. +1
    -1
      roles/nginx/handlers/main.yaml
  5. +1
    -1
      roles/wordpress/meta/main.yaml

+ 8
- 0
blogs.yaml View File

@ -0,0 +1,8 @@
---
- hosts: biff
roles:
- role: lxc_guest
vm_name: blogs
- hosts: blogs
roles:
- role: wordpress

+ 13
- 0
roles/apache2/handlers/main.yaml View File

@ -0,0 +1,13 @@
---
- include: service.yaml
# static: yes # see static include issue: https://github.com/ansible/ansible/issues/13485
vars:
service_name: apache2
- name: enable apache2 configuration
file:
src: "/etc/apache2/sites-available/{{ config_name }}"
dest: "/etc/apache2/sites-enabled/{{ config_name }}"
state: link
when: config_name is defined
notify: restart apache2

+ 2
- 9
roles/apache2/tasks/main.yaml View File

@ -1,26 +1,19 @@
---
- include: service.yaml
# static: yes # see static include issue: https://github.com/ansible/ansible/issues/13485
vars:
service_name: apache2
service_packages:
- apache2
- name: enable apache2 configuration
file:
src: "/etc/apache2/sites-available/{{ config_name }}"
dest: "/etc/apache2/sites-enabled/{{ config_name }}"
state: link
notify: restart apache2
- name: disable apache2 default configuration
file: path=/etc/apache2/sites-enabled/000-default.conf state=absent
notify: restart apache2
- name: upload apache proxy configuration
- name: install apache2 libapache2-mod-php5
apt: name="{{ item }}" state=present
with_items:
- libapache2-mod-php5
when: php | bool
notify:
- enable apache2 configuration
- restart apache2

+ 1
- 1
roles/nginx/handlers/main.yaml View File

@ -13,4 +13,4 @@
src: "/etc/nginx/sites-available/{{ config_name }}"
dest: "/etc/nginx/sites-enabled/{{ config_name }}"
state: link
# notify: restart nginx
notify: restart nginx

+ 1
- 1
roles/wordpress/meta/main.yaml View File

@ -1,4 +1,4 @@
---
dependencies:
- role: apache
- role: apache2
php: true

Loading…
Cancel
Save