Create vhosts, users, and document roots

This commit is contained in:
2021-10-25 21:41:35 -05:00
parent d92c35b296
commit 4afbe76369
4 changed files with 149 additions and 1 deletions

View File

@@ -114,6 +114,33 @@
loop: '{{ ensure_apache.firewall_list }}'
loop_control:
label: '{{ item.service }} will be {{ item.state }}'
- name: 'ensure users'
when:
- ansible_system == 'Linux'
- ensure_apache is defined
- http_vhost is defined
- http_vhost is iterable
ansible.builtin.user:
name: '{{ item.fqdn }}'
loop: '{{ http_vhost }}'
loop_control:
label: '{{ item.fqdn }} will be ensured'
- name: 'ensure vhost document roots'
when:
- ansible_system == 'Linux'
- ensure_apache is defined
- http_vhost is defined
- http_vhost is iterable
ansible.builtin.file:
group: '{{ item.fqdn }}'
owner: '{{ item.fqdn }}'
mode: '2775'
path: '/srv/http/{{ item.fqdn }}'
state: 'directory'
setype: 'httpd_sys_content_t'
loop: '{{ http_vhost }}'
loop_control:
label: '/srv/http/{{ item.fqdn }} will be ensured'
- name: 'ensure services'
when:
- ansible_system == 'Linux'