aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2025-10-11 17:55:49 +0200
committeralex <alex@pdp7.net>2025-10-11 17:56:46 +0200
commit340e1da68775afb99e049854624ae36ea2d46bd0 (patch)
treeab51283ac320687ded8f3334b537663964d2601a
parent6915da790011815ffb0f80d0708665e7dc3accb7 (diff)
Add userdirs
-rw-r--r--infrastructure/roles/users/tasks/main.yaml6
-rw-r--r--infrastructure/roles/web/tasks/main.yaml5
2 files changed, 11 insertions, 0 deletions
diff --git a/infrastructure/roles/users/tasks/main.yaml b/infrastructure/roles/users/tasks/main.yaml
index 37d616c..43ecc25 100644
--- a/infrastructure/roles/users/tasks/main.yaml
+++ b/infrastructure/roles/users/tasks/main.yaml
@@ -5,6 +5,12 @@
groups:
- sudo
loop: "{{ users }}"
+- name: accesible home directory (for web serving, for example)
+ ansible.builtin.file:
+ path: "/home/{{ item.name }}"
+ state: directory
+ mode: '0701'
+ loop: "{{ users }}"
- name: create .ssh directory
ansible.builtin.file:
path: "/home/{{ item.name }}/.ssh"
diff --git a/infrastructure/roles/web/tasks/main.yaml b/infrastructure/roles/web/tasks/main.yaml
index 2bf04e2..9ef0a15 100644
--- a/infrastructure/roles/web/tasks/main.yaml
+++ b/infrastructure/roles/web/tasks/main.yaml
@@ -11,6 +11,11 @@
cmd: a2enmod ssl
creates: /etc/apache2/mods-enabled/ssl.load
notify: restart web
+- name: enable mod_userdir
+ ansible.builtin.command:
+ cmd: a2enmod userdir
+ creates: /etc/apache2/mods-enabled/userdir.load
+ notify: restart web
- name: ssl site
ansible.builtin.copy:
dest: /etc/apache2/sites-enabled/ssl.conf