diff options
| author | Kumar Damani <me@kumardamani.net> | 2022-09-12 22:52:19 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2022-09-12 22:52:19 +0000 |
| commit | 6c8156a62ee472e5ecefdc1bc3f97b4dd8a72b68 (patch) | |
| tree | 29a7dd97a09f75d758bcd9513f053003394349e3 | |
| parent | 0a5f8b89f7e7316e79061b156e5a716ec350fc3b (diff) | |
website updateswebsites
| -rw-r--r-- | group_vars/all/vars.yaml | 3 | ||||
| -rw-r--r-- | roles/website/tasks/main.yaml | 10 |
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 }}' |
