diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..ea87f0b --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,11 @@ +--- + +- name: restart apache + service: + name: apache2 + state: restarted + +- name: reload apache + service: + name: apache2 + state: reloaded diff --git a/meta/main.yml b/meta/main.yml deleted file mode 100644 index e98f1aa..0000000 --- a/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - role: geerlingguy.apache diff --git a/meta/main.yml~ b/meta/main.yml~ deleted file mode 100644 index a0d86e7..0000000 --- a/meta/main.yml~ +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..4705dee --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,9 @@ +--- + +- include: setup_Debian.yml + +- name: default vhost + template: + src: default-vhost.j2 + dest: /etc/apache2/sites-available/000-default.conf + notify: reload apache diff --git a/tasks/setup_Debian.yml b/tasks/setup_Debian.yml new file mode 100644 index 0000000..4f2eba3 --- /dev/null +++ b/tasks/setup_Debian.yml @@ -0,0 +1,14 @@ +--- + +- name: install apt packages + apt: + pkg: "{{item}}" + state: present + with_items: + - apache2 + - libapache2-mod-php5 + +- name: remove default page + file: + path: /var/www/html/index.html + state: absent diff --git a/templates/default-vhost.j2 b/templates/default-vhost.j2 new file mode 100644 index 0000000..d96a3f4 --- /dev/null +++ b/templates/default-vhost.j2 @@ -0,0 +1,10 @@ + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + DocumentRoot /var/www/html/ + + Options -Indexes + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet