|
|
|
@ -2,29 +2,29 @@
|
|
|
|
|
- name: Copy config to home directory
|
|
|
|
|
copy:
|
|
|
|
|
src: home/
|
|
|
|
|
dest: "{{ ansible_env.HOME }}/"
|
|
|
|
|
dest: "{{ ansible_facts.env.HOME }}/"
|
|
|
|
|
mode: preserve
|
|
|
|
|
|
|
|
|
|
- name: Create link at ~/web
|
|
|
|
|
file:
|
|
|
|
|
src: /var/www/virtual/{{ ansible_user_id }}
|
|
|
|
|
dest: "{{ ansible_env.HOME }}/web"
|
|
|
|
|
src: /var/www/virtual/{{ ansible_facts.user_id }}
|
|
|
|
|
dest: "{{ ansible_facts.env.HOME }}/web"
|
|
|
|
|
state: link
|
|
|
|
|
|
|
|
|
|
- name: Initialize ~/web/sites
|
|
|
|
|
file:
|
|
|
|
|
path: /var/www/virtual/{{ ansible_user_id }}/sites
|
|
|
|
|
path: /var/www/virtual/{{ ansible_facts.user_id }}/sites
|
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
|
|
- name: Download and update projectr
|
|
|
|
|
git:
|
|
|
|
|
repo: https://github.com/lukasbestle/projectr.git
|
|
|
|
|
dest: "{{ ansible_env.HOME }}/.config/fish/pkgs/projectr"
|
|
|
|
|
dest: "{{ ansible_facts.env.HOME }}/.config/fish/pkgs/projectr"
|
|
|
|
|
|
|
|
|
|
- name: Set up deploy script
|
|
|
|
|
template:
|
|
|
|
|
src: deploy.php.j2
|
|
|
|
|
dest: /var/www/virtual/{{ ansible_user_id }}/html/deploy.php
|
|
|
|
|
dest: /var/www/virtual/{{ ansible_facts.user_id }}/html/deploy.php
|
|
|
|
|
|
|
|
|
|
- name: Read existing Uberspace domains
|
|
|
|
|
command: uberspace web domain list
|
|
|
|
@ -34,15 +34,15 @@
|
|
|
|
|
- name: Add configured domains to Uberspace config
|
|
|
|
|
shell: "uberspace web domain add $(idn {{ item.key }})"
|
|
|
|
|
when: item.key not in uberspace_web_domain_result.stdout_lines
|
|
|
|
|
loop: "{{ web_links.get(ansible_user_id, {}) | dict2items }}"
|
|
|
|
|
loop: "{{ web_links.get(ansible_facts.user_id, {}) | dict2items }}"
|
|
|
|
|
|
|
|
|
|
- name: Set up sites using projectr
|
|
|
|
|
command:
|
|
|
|
|
argv:
|
|
|
|
|
- site_add
|
|
|
|
|
- "{{ item.key }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_user_id }}/sites/{{ item.key }}
|
|
|
|
|
loop: "{{ web_sites.get(ansible_user_id, {}) | dict2items }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_facts.user_id }}/sites/{{ item.key }}
|
|
|
|
|
loop: "{{ web_sites.get(ansible_facts.user_id, {}) | dict2items }}"
|
|
|
|
|
|
|
|
|
|
- name: Set up site origins using projectr (sites with origin)
|
|
|
|
|
command:
|
|
|
|
@ -50,8 +50,8 @@
|
|
|
|
|
- site_origin
|
|
|
|
|
- "{{ item.key }}"
|
|
|
|
|
- "{{ item.value }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_user_id }}/sites/{{ item.key }}/.origin
|
|
|
|
|
loop: "{{ web_sites.get(ansible_user_id, {}) | dict2items }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_facts.user_id }}/sites/{{ item.key }}/.origin
|
|
|
|
|
loop: "{{ web_sites.get(ansible_facts.user_id, {}) | dict2items }}"
|
|
|
|
|
when: item.value != None
|
|
|
|
|
|
|
|
|
|
- name: Set up site origins using projectr (sites without origin)
|
|
|
|
@ -59,8 +59,8 @@
|
|
|
|
|
argv:
|
|
|
|
|
- site_origin
|
|
|
|
|
- "{{ item.key }}"
|
|
|
|
|
removes: /var/www/virtual/{{ ansible_user_id }}/sites/{{ item.key }}/.origin
|
|
|
|
|
loop: "{{ web_sites.get(ansible_user_id, {}) | dict2items }}"
|
|
|
|
|
removes: /var/www/virtual/{{ ansible_facts.user_id }}/sites/{{ item.key }}/.origin
|
|
|
|
|
loop: "{{ web_sites.get(ansible_facts.user_id, {}) | dict2items }}"
|
|
|
|
|
when: item.value == None
|
|
|
|
|
|
|
|
|
|
- name: Deploy sites using projectr (sites with origin)
|
|
|
|
@ -68,8 +68,8 @@
|
|
|
|
|
argv:
|
|
|
|
|
- site_deploy
|
|
|
|
|
- "{{ item.key }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_user_id }}/sites/{{ item.key }}/current
|
|
|
|
|
loop: "{{ web_sites.get(ansible_user_id, {}) | dict2items }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_facts.user_id }}/sites/{{ item.key }}/current
|
|
|
|
|
loop: "{{ web_sites.get(ansible_facts.user_id, {}) | dict2items }}"
|
|
|
|
|
when: item.value != None
|
|
|
|
|
|
|
|
|
|
- name: Link sites to domains
|
|
|
|
@ -79,19 +79,19 @@
|
|
|
|
|
- "{{ item.value.site }}"
|
|
|
|
|
- "{{ item.key }}"
|
|
|
|
|
- "{{ item.value.get('path', '') }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_user_id }}/{{ item.key }}
|
|
|
|
|
loop: "{{ web_links.get(ansible_user_id, {}) | dict2items }}"
|
|
|
|
|
creates: /var/www/virtual/{{ ansible_facts.user_id }}/{{ item.key }}
|
|
|
|
|
loop: "{{ web_links.get(ansible_facts.user_id, {}) | dict2items }}"
|
|
|
|
|
|
|
|
|
|
- name: Ensure that qdated directories for all Mail Uberspaces exist
|
|
|
|
|
file:
|
|
|
|
|
path: "{{ ansible_env.HOME }}/.config/qdated/{{ hostvars[item].ansible_user_id }}"
|
|
|
|
|
path: "{{ ansible_facts.env.HOME }}/.config/qdated/{{ hostvars[item].ansible_facts.user_id }}"
|
|
|
|
|
state: directory
|
|
|
|
|
loop: "{{ groups.mail }}"
|
|
|
|
|
|
|
|
|
|
- name: Copy qdated keys from all Mail Uberspaces
|
|
|
|
|
copy:
|
|
|
|
|
content: "{{ hostvars[item].qdated_key }}"
|
|
|
|
|
dest: "{{ ansible_env.HOME }}/.config/qdated/{{ hostvars[item].ansible_user_id }}/.qdated-key"
|
|
|
|
|
dest: "{{ ansible_facts.env.HOME }}/.config/qdated/{{ hostvars[item].ansible_facts.user_id }}/.qdated-key"
|
|
|
|
|
loop: "{{ groups.mail }}"
|
|
|
|
|
|
|
|
|
|
- name: Set up qdated address generation cronjob
|
|
|
|
@ -99,7 +99,7 @@
|
|
|
|
|
name: "qdated generation"
|
|
|
|
|
hour: "2"
|
|
|
|
|
minute: "3"
|
|
|
|
|
job: "{{ ansible_env.HOME }}/bin/qdated-generate"
|
|
|
|
|
job: "{{ ansible_facts.env.HOME }}/bin/qdated-generate"
|
|
|
|
|
|
|
|
|
|
- name: Check if the access log is enabled
|
|
|
|
|
command: uberspace web log access status
|
|
|
|
|