Commit d2c5d64e authored by Pietsch, Martin's avatar Pietsch, Martin
Browse files

added main and configure tasks

parent d8ebb8b8
---
- name: "create www directory"
ansible.builtin.file:
path: "{{ www_root_directory }}"
state: directory
owner: "{{ www_user }}"
group: "{{ www_group }}"
mode: 0755
- name: "configure SSL"
block:
- name: "get stat of SSL private directory"
ansible.builtin.stat:
path: "{{ '%s/ssl/private' | format(system_config_directory) }"
register: _stat_sslprivdir
- name: "install SSL private key"
ansible.builtin.copy:
src: "{{ www_ssl_priv_key }}"
dst: "{{ '%s/ssl/private/%s' | format(system_config_directory, www_ssl_priv_key) }}"
mode: 0640
owner: "{{ _stat_sslprivdir.stat.pw_name }}"
group: "{{ _stat_sslprivdir.stat.gr_name }}"
- name: "get stat of SSL private directory"
ansible.builtin.stat:
path: "{{ '%s/ssl/certs' | format(system_config_directory) }}"
register: _stat_sslcertsdir
- name: "install SSL certificate"
ansible.builtin.copy:
src: "{{ www_ssl_cert }}"
dst: "{{ '%s/ssl/certs/%s' | format(system_config_directory, www_ssl_cert) }}"
mode: 0644
owner: "{{ _stat_sslcertdir.stat.pw_name }}"
group: "{{ _stat_sslcertdir.stat.gr_name }}"
- name: "install SSL CA certificate"
ansible.builtin.copy:
src: "{{ www_ssl_ca_cert }}"
dst: "{{ '%s/ssl/certs/%s' | format(system_config_directory, www_ssl_ca_cert) }}"
mode: 0644
owner: "{{ _stat_sslcertdir.stat.pw_name }}"
group: "{{ _stat_sslcertdir.stat.gr_name }}"
when: (www_ssl_ca_cert | length) > 0
when: (www_ssl_priv_key | length) > 0 and (www_ssl_cert | length) > 0
notify:
- "reload service"
- name: "execute inherited configure"
sdm.oor.call_tasks:
from: configure
super: True
---
- name: "execute inherited main"
sdm.oor.call_tasks:
from: "main"
super: True
- name: "create www group"
ansible.builtin.group:
name: "{{ www_group }}"
system: True
- name: "create www user"
ansible.builtin.user:
name: "{{ www_user }}"
comment: "www user"
create_home: False
group: "{{ www_group }}"
home: "{{ www_root_directory }}"
shell: "/usr/sbin/nologin"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment