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