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: I041a044ef88aff917eeb3a618c2c08ac9ceb80fe
(cherry picked from commit bbe5bb7c3c)
This commit is contained in:
Jean-Philippe Evrard 2017-03-07 15:55:58 +00:00 committed by Jesse Pretorius (odyssey4me)
parent e69ea7a934
commit 4f4e75db88
3 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Ensure apache log folder exists
file:
dest: "{{ horizon_apache_default_log_folder }}"
state: directory
owner: "{{ horizon_apache_default_log_owner }}"
group: "{{ horizon_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
- name: Enable apache2 modules

View File

@ -31,6 +31,9 @@ horizon_distro_packages:
- gettext
horizon_apache_conf: "/etc/apache2/apache2.conf"
horizon_apache_default_log_folder: "/var/log/apache2"
horizon_apache_default_log_owner: "root"
horizon_apache_default_log_grp: "adm"
horizon_apache_security_conf: "/etc/apache2/conf-available/security.conf"
horizon_apache_site_available: "/etc/apache2/sites-available/openstack-dashboard.conf"

View File

@ -31,6 +31,9 @@ horizon_distro_packages:
- which
horizon_apache_conf: "/etc/httpd/conf/httpd.conf"
horizon_apache_default_log_folder: "/var/log/httpd"
horizon_apache_default_log_owner: "root"
horizon_apache_default_log_grp: "root"
horizon_apache_security_conf: "{{ horizon_apache_conf }}"
horizon_apache_configs: