Ensure the log folder exists

Restarting the apache service under ubuntu read the envvars file.
This envvars contains the folder for logrotate. If the folder
doesn't exist or hasn't the apache permissions, the restart of
the service will fail.

We ensure here the folder properly exists, with the right
permissions.

Change-Id: I4abf785f6d3d8ca4a5fc3c9520d046618cf6f380
This commit is contained in:
Jean-Philippe Evrard 2017-03-07 11:14:33 +00:00 committed by Jesse Pretorius (odyssey4me)
parent 1897a675c3
commit 15725b7128
3 changed files with 13 additions and 0 deletions

View File

@ -25,6 +25,13 @@
system: "yes"
shell: "/bin/false"
- name: Ensure apache log folder exists
file:
dest: "{{ keystone_apache_default_log_folder }}"
state: directory
owner: "{{ keystone_apache_default_log_owner }}"
group: "{{ keystone_apache_default_log_grp }}"
## Workaround for https://github.com/ansible/ansible-modules-core/issues/5328
## TODO: Replace using apache2_module when fixed in Ansible release
## NOTE(cloudnull):

View File

@ -58,6 +58,9 @@ keystone_apache_default_sites:
- "/etc/httpd/conf.d/ssl.conf"
keystone_apache_conf: "/etc/httpd/conf/httpd.conf"
keystone_apache_default_log_folder: "/var/log/httpd"
keystone_apache_default_log_owner: "root"
keystone_apache_default_log_grp: "root"
keystone_apache_security_conf: "{{ keystone_apache_conf }}"
keystone_apache_configs:

View File

@ -58,6 +58,9 @@ keystone_apache_default_sites:
keystone_apache_site_available: "/etc/apache2/sites-available/keystone-httpd.conf"
keystone_apache_site_enabled: "/etc/apache2/sites-enabled/keystone-httpd.conf"
keystone_apache_conf: "/etc/apache2/apache2.conf"
keystone_apache_default_log_folder: "/var/log/apache2"
keystone_apache_default_log_owner: "root"
keystone_apache_default_log_grp: "adm"
keystone_apache_security_conf: "/etc/apache2/conf-available/security.conf"
keystone_apache_configs: