aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--group_vars/all/vars.yaml3
-rw-r--r--roles/website/tasks/main.yaml10
2 files changed, 12 insertions, 1 deletions
diff --git a/group_vars/all/vars.yaml b/group_vars/all/vars.yaml
index 4daa21d..12fd063 100644
--- a/group_vars/all/vars.yaml
+++ b/group_vars/all/vars.yaml
@@ -60,10 +60,13 @@ apps_conf_map:
# Only include when applicable.
# git_version: the git branch to use for the pull.
# Only include when applicable.
+# html_root: the path to where the html base dir is.
+# NOTE: Must end with /
nginx_websites:
- name: 'kumardamani.net'
git_url: 'https://{{ (git_user|default(None)) | urlencode() }}:{{ (git_pass|default(None)) | urlencode() }}@gitlab.com/kdam0/kumardamani.net.git' # noqa yaml
git_version: 'main'
+ html_root: 'public/'
- name: 'amayastuff.com'
vpn_domain: 'kdvpn.crabdance.com'
diff --git a/roles/website/tasks/main.yaml b/roles/website/tasks/main.yaml
index 9725f2d..66bc955 100644
--- a/roles/website/tasks/main.yaml
+++ b/roles/website/tasks/main.yaml
@@ -17,7 +17,7 @@
- name: 'Clone all the website project repos'
git:
repo: '{{ item.git_url }}'
- dest: '{{ sites_data_root }}/{{ item.name }}/html'
+ dest: '/home/{{ ansible_user }}/{{ item.name }}'
depth: 1
update: true
force: true
@@ -25,3 +25,11 @@
umask: '002'
when: 'item.git_url is defined'
loop: '{{ websites }}'
+
+- name: 'Move all the html bases to data root'
+ copy:
+ src: '/home/{{ ansible_user }}/{{ item.name }}/{{ item.html_root }}/'
+ dest: '{{ sites_data_root }}/{{ item.name }}/html/'
+ remote_src: true
+ when: 'item.git_url is defined'
+ loop: '{{ websites }}'