From 8cc6688469c9d64de246e941a34bb3bf43c59273 Mon Sep 17 00:00:00 2001 From: Salt Date: Thu, 27 Feb 2020 05:16:02 -0600 Subject: [PATCH] Migrate domains, reorganize websites so that they actually leverage sites-available and sites-enabled --- ec2.yml | 12 ++++++------ roles/dokuwiki/tasks/main.yml | 7 ++++++- roles/gitweb/tasks/main.yml | 7 ++++++- roles/https/tasks/main.yml | 12 ++++++------ roles/nextcloud/tasks/main.yml | 7 ++++++- roles/redirect/tasks/main.yml | 7 ++++++- 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/ec2.yml b/ec2.yml index d8123d2..ad1c95e 100644 --- a/ec2.yml +++ b/ec2.yml @@ -10,7 +10,7 @@ mcname: "botaniapack-1" mczip: "https://www.assburgers.club/files/botaniapack-1.zip" mcforge: "1.10.2-12.18.3.2511" - mcmotd: "First time on Assburgers edition" + mcmotd: "First time on 9iron edition" roles: - minecraft - hosts: tag_ansiblehost_true @@ -32,18 +32,18 @@ roles: - role: redirect vars: - redirect_from: "assburgers.club" - redirect_to: "www.assburgers.club" + redirect_from: "9iron.club" + redirect_to: "www.9iron.club" redirect_webroot: "/var/www/redirect" - role: gitweb vars: gitweb_repo: "https://gitlab.com/rehashedsalt/www" - gitweb_url: "www.assburgers.club" + gitweb_url: "www.9iron.club" gitweb_webroot: "/var/www/www" - role: dokuwiki vars: dokuwiki_tgz: "https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz" - dokuwiki_url: "wiki.assburgers.club" + dokuwiki_url: "wiki.9iron.club" dokuwiki_webroot: "/var/www/dokuwiki" - role: nextcloud vars: @@ -55,5 +55,5 @@ 3332313764623133630a393731613236373837316437653265636663666261383135636662373566 61373135303632336237333836353764646639633735323566346366623766646266 nextcloud_tarbz2: "https://download.nextcloud.com/server/releases/nextcloud-18.0.0.tar.bz2" - nextcloud_url: "nc.assburgers.club" + nextcloud_url: "nc.9iron.club" nextcloud_webroot: "/var/www/nextcloud" diff --git a/roles/dokuwiki/tasks/main.yml b/roles/dokuwiki/tasks/main.yml index 0cf0a83..65d822d 100644 --- a/roles/dokuwiki/tasks/main.yml +++ b/roles/dokuwiki/tasks/main.yml @@ -43,7 +43,12 @@ - name: Copy over virtual host configs template: src: apache2-vhost-ssl.conf - dest: "/etc/apache2/sites-enabled/{{ dokuwiki_url }}.conf" + dest: "/etc/apache2/sites-available/{{ dokuwiki_url }}.conf" + notify: restart apache + - name: Enable config + command: + cmd: "a2ensite {{ dokuwiki_url }}.conf" + creates: "/etc/apache2/sites-enabled/{{ dokuwiki_url }}.conf" notify: restart apache - name: Generate certificate include_role: diff --git a/roles/gitweb/tasks/main.yml b/roles/gitweb/tasks/main.yml index cf0e718..dbf787b 100644 --- a/roles/gitweb/tasks/main.yml +++ b/roles/gitweb/tasks/main.yml @@ -18,7 +18,12 @@ - name: Copy over virtual host configs template: src: apache2-vhost-ssl.conf - dest: "/etc/apache2/sites-enabled/{{ gitweb_url }}.conf" + dest: "/etc/apache2/sites-available/{{ gitweb_url }}.conf" + notify: restart apache + - name: Enable config + command: + cmd: "a2ensite {{ gitweb_url }}.conf" + creates: "/etc/apache2/sites-enabled/{{ gitweb_url }}.conf" notify: restart apache - name: Generate certificate include_role: diff --git a/roles/https/tasks/main.yml b/roles/https/tasks/main.yml index d6f9b32..c8901ed 100644 --- a/roles/https/tasks/main.yml +++ b/roles/https/tasks/main.yml @@ -47,10 +47,10 @@ block: - name: Fulfill challenge block: - - name: Back up website config - command: "mv /etc/apache2/sites-enabled/{{ website_url }}.conf /etc/apache2/sites-available/{{ website_url }}.conf" - args: - creates: "/etc/apache2/sites-available/{{ website_url }}.conf" + - name: Disable website + command: + cmd: "a2dissite {{ website_url }}.conf" + removes: "/etc/apache2/sites-enabled/{{ website_url }}.conf" - name: Create temporary config template: src: apache2-vhost.conf @@ -101,8 +101,8 @@ path: "/etc/apache2/sites-enabled/{{ website_url }}.conf" state: absent - name: Restore original config - command: "/usr/bin/mv /etc/apache2/sites-available/{{ website_url }}.conf /etc/apache2/sites-enabled/{{ website_url }}.conf" - args: + command: + cmd: "a2ensite {{ website_url }}.conf" creates: "/etc/apache2/sites-enabled/{{ website_url }}.conf" when: com_challenge['challenge_data']|length > 0 - name: Reload Apache diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index dbf65a3..896a020 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -79,7 +79,12 @@ - name: Copy over virtual host configs template: src: apache2-vhost-ssl.conf - dest: "/etc/apache2/sites-enabled/{{ nextcloud_url }}.conf" + dest: "/etc/apache2/sites-available/{{ nextcloud_url }}.conf" + notify: restart apache + - name: Enable config + command: + cmd: "a2ensite {{ nextcloud_url }}.conf" + creates: "/etc/apache2/sites-enabled/{{ nextcloud_url }}.conf" notify: restart apache - name: Generate certificate include_role: diff --git a/roles/redirect/tasks/main.yml b/roles/redirect/tasks/main.yml index 24f8de0..2a72090 100644 --- a/roles/redirect/tasks/main.yml +++ b/roles/redirect/tasks/main.yml @@ -6,7 +6,12 @@ - name: Copy over redirect config template: src: apache2-redirect.conf - dest: "/etc/apache2/sites-enabled/{{ redirect_from }}.conf" + dest: "/etc/apache2/sites-available/{{ redirect_from }}.conf" + notify: restart apache + - name: Enable config + command: + cmd: "a2ensite {{ redirect_from }}.conf" + creates: "/etc/apache2/sites-enabled/{{ redirect_from }}.conf" notify: restart apache - name: Generate certificate include_role: