role apache_vhost: up and running
This commit is contained in:
49
tasks/main.yml
Normal file
49
tasks/main.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
# tasks file for apache_vhost
|
||||
- name: create dedicated user
|
||||
user:
|
||||
name: "{{ apache_user }}"
|
||||
groups:
|
||||
- apache
|
||||
- ssh_users
|
||||
home: "{{ apache_base_dir }}"
|
||||
shell: /bin/bash
|
||||
|
||||
- name: vhost config file
|
||||
template:
|
||||
src: vhost.conf.jj
|
||||
dest: /etc/httpd/conf.d/{{ apache_server_name }}.conf
|
||||
mode: 0644
|
||||
notify: restart apache
|
||||
|
||||
- name: php-fpm config file
|
||||
template:
|
||||
src: pool.conf.jj
|
||||
dest: /etc/opt/remi/php73/php-fpm.d/{{apache_server_name }}.conf
|
||||
notify: restart php-fpm
|
||||
when: apache_use_php
|
||||
|
||||
- name: create directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ apache_user }}"
|
||||
group: apache
|
||||
mode: 0750
|
||||
loop:
|
||||
- "{{ apache_base_dir }}"
|
||||
- "{{ apache_base_dir }}/logs"
|
||||
- "{{ apache_base_dir }}/www"
|
||||
- "{{ apache_base_dir }}/session"
|
||||
- "{{ apache_base_dir }}/wsdlcache"
|
||||
|
||||
- name: logrotate config file
|
||||
template:
|
||||
src: logrotate.conf.jj
|
||||
dest: "/etc/logrotate.d/{{ apache_server_name }}.conf"
|
||||
mode: 0644
|
||||
|
||||
- name: goaccess
|
||||
import_tasks: goaccess.yml
|
||||
when: apache_stats
|
||||
tags: stats
|
||||
Reference in New Issue
Block a user