From 4e04c35f04c264d728587a54d0515eef0a42a44b Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Wed, 19 Apr 2017 18:17:40 +0200 Subject: build/: Make room for new deployment scheme --- ansible/roles/web/files/gondul.conf | 39 ++++++++++++++++++++++++++++++++ ansible/roles/web/handlers/main.yml | 3 +++ ansible/roles/web/tasks/main.yml | 44 +++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 ansible/roles/web/files/gondul.conf create mode 100644 ansible/roles/web/handlers/main.yml create mode 100644 ansible/roles/web/tasks/main.yml (limited to 'ansible/roles/web') diff --git a/ansible/roles/web/files/gondul.conf b/ansible/roles/web/files/gondul.conf new file mode 100644 index 0000000..0cdbff7 --- /dev/null +++ b/ansible/roles/web/files/gondul.conf @@ -0,0 +1,39 @@ + + ServerAdmin lol@example.com + ServerName gondul.gathering.org + ServerAlias gondul.gathering.org + + DocumentRoot /opt/gondul/web + ScriptAlias /api/write/ /opt/gondul/web/api/write/ + ScriptAlias /api/read/ /opt/gondul/web/api/read/ + ScriptAlias /api/public/ /opt/gondul/web/api/public/ + + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + + + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + + + AllowOverride None + Options +ExecCGI -MultiViews +Indexes +SymLinksIfOwnerMatch + Require all granted + + + AllowOverride None + Options Indexes FollowSymLinks MultiViews + AddDefaultCharset UTF-8 + Require all granted + + + ErrorLog /var/log/apache2/error-nms.example.com.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog /var/log/apache2/access-nms.example.com.log combined + ServerSignature On + + diff --git a/ansible/roles/web/handlers/main.yml b/ansible/roles/web/handlers/main.yml new file mode 100644 index 0000000..407739b --- /dev/null +++ b/ansible/roles/web/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: restart apache + service: name=apache2 state=restarted diff --git a/ansible/roles/web/tasks/main.yml b/ansible/roles/web/tasks/main.yml new file mode 100644 index 0000000..b716f87 --- /dev/null +++ b/ansible/roles/web/tasks/main.yml @@ -0,0 +1,44 @@ +- name: Install front-packages + apt: + name: "{{ item }}" + state: present + with_items: + - libcapture-tiny-perl + - libcommon-sense-perl + - libdata-dumper-simple-perl + - libdbd-pg-perl + - libdbi-perl + - libdigest-perl + - libgd-perl + - libgeo-ip-perl + - libhtml-parser-perl + - libhtml-template-perl + - libjson-perl + - libjson-xs-perl + - libnetaddr-ip-perl + - libnet-cidr-perl + - libnet-ip-perl + - libnet-oping-perl + - libnet-rawip-perl + - libsnmp-perl + - libsocket6-perl + - libsocket-perl + - libswitch-perl + - libtimedate-perl + - perl + - perl-base + - perl-modules + - libfreezethaw-perl + - apache2 + +- apache2_module: + state: present + name: cgid + notify: restart apache +- command: a2dissite 000-default + ignore_errors: true +- name: Enable gondul-config + copy: + dest: /etc/apache2/sites-enabled/ + src: gondul.conf + notify: restart apache -- cgit v1.2.3