From 8378c445d809e9ff6392ec2807d6fc48be5b128a Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Wed, 30 Aug 2017 22:17:34 +0000 Subject: [PATCH] current --- handlers/main.yml | 11 +++++++++++ meta/main.yml | 2 -- meta/main.yml~ | 2 -- tasks/main.yml | 9 +++++++++ tasks/setup_Debian.yml | 14 ++++++++++++++ templates/default-vhost.j2 | 10 ++++++++++ 6 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 handlers/main.yml delete mode 100644 meta/main.yml delete mode 100644 meta/main.yml~ create mode 100644 tasks/main.yml create mode 100644 tasks/setup_Debian.yml create mode 100644 templates/default-vhost.j2 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