diff --git a/blogs.yaml b/blogs.yaml new file mode 100644 index 0000000..4b2d672 --- /dev/null +++ b/blogs.yaml @@ -0,0 +1,8 @@ +--- +- hosts: biff + roles: + - role: lxc_guest + vm_name: blogs +- hosts: blogs + roles: + - role: wordpress diff --git a/roles/apache2/handlers/main.yaml b/roles/apache2/handlers/main.yaml new file mode 100644 index 0000000..20ae0f2 --- /dev/null +++ b/roles/apache2/handlers/main.yaml @@ -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 diff --git a/roles/apache2/tasks/main.yaml b/roles/apache2/tasks/main.yaml index caebde7..8f3b628 100644 --- a/roles/apache2/tasks/main.yaml +++ b/roles/apache2/tasks/main.yaml @@ -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 diff --git a/roles/nginx/handlers/main.yaml b/roles/nginx/handlers/main.yaml index 2152b70..aa89734 100644 --- a/roles/nginx/handlers/main.yaml +++ b/roles/nginx/handlers/main.yaml @@ -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 diff --git a/roles/wordpress/meta/main.yaml b/roles/wordpress/meta/main.yaml index 5e2cab7..0514b7a 100644 --- a/roles/wordpress/meta/main.yaml +++ b/roles/wordpress/meta/main.yaml @@ -1,4 +1,4 @@ --- dependencies: - - role: apache + - role: apache2 php: true