Ensure sysstat is running on CentOS

This patch fixes sysstat on CentOS so that it runs properly.

Closes-Bug: 1717361
Change-Id: If95b0e02d7863291f88b67909128439599660ad0
(cherry picked from commit e9f75bf860)
This commit is contained in:
Major Hayden 2017-09-14 15:21:33 -06:00
parent 963937e326
commit d557a4c147
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
4 changed files with 30 additions and 2 deletions

View File

@ -103,3 +103,6 @@ openstack_domain: openstack.local
# Global environment variables should be empty by default
global_environment_variables: {}
# Set the default mode for the /etc/cron.d/sysstat file
openstack_host_sysstat_cron_mode: '0755'

View File

@ -0,0 +1,8 @@
---
fixes:
- |
The ``sysstat`` package was installed on all distributions, but it was
only configured to run on Ubuntu and OpenSUSE. It would not run on CentOS
due to bad SELinux contexts and file permissions on
``/etc/cron.d/sysstat``. This has been fixed and ``sysstat`` now runs
properly on CentOS.

View File

@ -20,13 +20,28 @@
mode: "0644"
when:
- openstack_host_sysstat_enabled | bool
- ansible_os_family == "Debian"
- ansible_pkg_mgr == 'apt'
notify: Restart sysstat
- name: Enable sysstat cron
template:
src: "{{ openstack_host_cron_template }}"
dest: "/etc/cron.d/sysstat"
mode: "0755"
mode: "{{ openstack_host_sysstat_cron_mode }}"
when:
- openstack_host_sysstat_enabled | bool
- name: Restore SELinux contexts on sysstat cron file
command: restorecon -v /etc/cron.d/sysstat
when:
- openstack_host_sysstat_enabled | bool
- ansible_pkg_mgr in ['yum', 'dnf']
- name: Start and enable the sysstat service
service:
name: sysstat
state: started
enabled: yes
when:
- openstack_host_sysstat_enabled | bool
- ansible_pkg_mgr in ['yum', 'dnf', 'zypper']

View File

@ -19,6 +19,8 @@ openstack_host_sysstat_file: /etc/sysconfig/sysstat
openstack_host_cron_template: sysstat.cron.redhat.j2
openstask_host_module_file: /etc/modules-load.d/openstack-ansible.conf
openstack_host_sysstat_cron_mode: '0600'
## Kernel modules loaded on hosts
openstack_host_kernel_modules:
- 8021q