diff options
Diffstat (limited to 'ansible/roles')
4 files changed, 55 insertions, 25 deletions
diff --git a/ansible/roles/mw-backend/handlers/main.yml b/ansible/roles/mw-backend/handlers/main.yml new file mode 100644 index 0000000..0298ff9 --- /dev/null +++ b/ansible/roles/mw-backend/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: update apt cache + become: yes + apt: + update_cache: yes diff --git a/ansible/roles/mw-backend/tasks/main.yml b/ansible/roles/mw-backend/tasks/main.yml new file mode 100644 index 0000000..799f0e5 --- /dev/null +++ b/ansible/roles/mw-backend/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: apt setup + tags: packages + become: yes + block: + - copy: + dest: /etc/apt/apt.conf.d/99force-ipv4 + content: 'Acquire::ForceIPv4 "true";' + notify: update apt cache + + - meta: flush_handlers + +# - name: packages +# tags: packages +# become: yes +# apt: +# name: "{{ item }}" +# install_recommends: no +# with_items: +# - ping +# - apache2 diff --git a/ansible/roles/mw-frontend/files/etc/apache2/sites-available/mw.trygvis.io-ssl.conf b/ansible/roles/mw-frontend/files/etc/apache2/sites-available/mw.trygvis.io-ssl.conf index 6260e2e..533c559 100644 --- a/ansible/roles/mw-frontend/files/etc/apache2/sites-available/mw.trygvis.io-ssl.conf +++ b/ansible/roles/mw-frontend/files/etc/apache2/sites-available/mw.trygvis.io-ssl.conf @@ -1,29 +1,30 @@ +# Ansible <IfModule mod_ssl.c> <VirtualHost *:443> - ServerAdmin root@trygvis.io - ServerName mw.trygvis.io + ServerAdmin root@trygvis.io + ServerName mw.trygvis.io - LogLevel warn - ErrorLog ${APACHE_LOG_DIR}/mw.trygvis.io-error.log - CustomLog ${APACHE_LOG_DIR}/mw.trygvis.io-access.log combined + LogLevel warn + ErrorLog ${APACHE_LOG_DIR}/mw.trygvis.io-error.log + CustomLog ${APACHE_LOG_DIR}/mw.trygvis.io-access.log combined - DocumentRoot /var/www/mw.trygvis.io/htdocs - <Directory /> - Options FollowSymLinks - AllowOverride None - </Directory> - <Directory /var/www/mw.trygvis.io/htdocs/> - Options Indexes FollowSymLinks MultiViews - AllowOverride None - Order allow,deny - allow from all - </Directory> + DocumentRoot /var/www/mw.trygvis.io/htdocs + <Directory /> + Options FollowSymLinks + AllowOverride None + </Directory> + <Directory /var/www/mw.trygvis.io/htdocs/> + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Order allow,deny + allow from all + </Directory> - ProxyPreserveHost On - ProxyPass / http://conflatorio.vpn.trygvis.io:8080/ + ProxyPreserveHost On + ProxyPass / http://mw.trygvis.io/ - SSLCertificateFile /etc/letsencrypt/live/mw.trygvis.io/fullchain.pem - SSLCertificateKeyFile /etc/letsencrypt/live/mw.trygvis.io/privkey.pem - Include /etc/letsencrypt/options-ssl-apache.conf + SSLCertificateFile /etc/letsencrypt/live/mw.trygvis.io/fullchain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/mw.trygvis.io/privkey.pem + Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> diff --git a/ansible/roles/mw-frontend/tasks/main.yml b/ansible/roles/mw-frontend/tasks/main.yml index b7bb13f..40906ea 100644 --- a/ansible/roles/mw-frontend/tasks/main.yml +++ b/ansible/roles/mw-frontend/tasks/main.yml @@ -1,5 +1,8 @@ --- -- name: apache config - copy: - src: etc/apache2/sites-available/mw.trygvis.io-ssl.conf - dest: /etc/apache2/sites-available/mw.trygvis.io-ssl.conf +- name: Apache config + become: yes + block: + - name: apache config + copy: + src: etc/apache2/sites-available/mw.trygvis.io-ssl.conf + dest: /etc/apache2/sites-available/mw.trygvis.io-ssl.conf |