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:
parent
963937e326
commit
d557a4c147
|
@ -103,3 +103,6 @@ openstack_domain: openstack.local
|
||||||
|
|
||||||
# Global environment variables should be empty by default
|
# Global environment variables should be empty by default
|
||||||
global_environment_variables: {}
|
global_environment_variables: {}
|
||||||
|
|
||||||
|
# Set the default mode for the /etc/cron.d/sysstat file
|
||||||
|
openstack_host_sysstat_cron_mode: '0755'
|
||||||
|
|
|
@ -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.
|
|
@ -20,13 +20,28 @@
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
when:
|
when:
|
||||||
- openstack_host_sysstat_enabled | bool
|
- openstack_host_sysstat_enabled | bool
|
||||||
- ansible_os_family == "Debian"
|
- ansible_pkg_mgr == 'apt'
|
||||||
notify: Restart sysstat
|
notify: Restart sysstat
|
||||||
|
|
||||||
- name: Enable sysstat cron
|
- name: Enable sysstat cron
|
||||||
template:
|
template:
|
||||||
src: "{{ openstack_host_cron_template }}"
|
src: "{{ openstack_host_cron_template }}"
|
||||||
dest: "/etc/cron.d/sysstat"
|
dest: "/etc/cron.d/sysstat"
|
||||||
mode: "0755"
|
mode: "{{ openstack_host_sysstat_cron_mode }}"
|
||||||
when:
|
when:
|
||||||
- openstack_host_sysstat_enabled | bool
|
- 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']
|
||||||
|
|
|
@ -19,6 +19,8 @@ openstack_host_sysstat_file: /etc/sysconfig/sysstat
|
||||||
openstack_host_cron_template: sysstat.cron.redhat.j2
|
openstack_host_cron_template: sysstat.cron.redhat.j2
|
||||||
openstask_host_module_file: /etc/modules-load.d/openstack-ansible.conf
|
openstask_host_module_file: /etc/modules-load.d/openstack-ansible.conf
|
||||||
|
|
||||||
|
openstack_host_sysstat_cron_mode: '0600'
|
||||||
|
|
||||||
## Kernel modules loaded on hosts
|
## Kernel modules loaded on hosts
|
||||||
openstack_host_kernel_modules:
|
openstack_host_kernel_modules:
|
||||||
- 8021q
|
- 8021q
|
||||||
|
|
Loading…
Reference in New Issue