Only configure systat on debian based system.

template systat cron for centos

only install /etc/default/systat on ubuntu
/etc/default/sysstat only configure debian-sa1 which is not on centos

introduce 2 vars :
 openstack_host_sysstat_file
 openstack_host_cron_template

Change-Id: Ib4fde6e4b9d3ce23524a5b5a17dbf15065bbeb4c
This commit is contained in:
Marc Gariepy 2016-09-02 09:09:42 -04:00
parent cb25f0b227
commit 85ecc37e11
7 changed files with 30 additions and 9 deletions

View File

@ -13,13 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable sysstat
- name: Enable sysstat config
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode|default('0644')}}"
with_items:
- { src: "sysstat.default.j2", dest: "/etc/default/sysstat" }
- { src: "sysstat.cron.j2", dest: "/etc/cron.d/sysstat", mode: "0755" }
when: openstack_host_sysstat_enabled | bool
src: "sysstat.default.j2"
dest: "{{ openstack_host_sysstat_file }}"
mode: "0644"
when:
- openstack_host_sysstat_enabled | bool
- ansible_os_family == "Debian"
notify: Restart sysstat
- name: Enable sysstat cron
template:
src: "{{ openstack_host_cron_template }}"
dest: "/etc/cron.d/sysstat"
mode: "0755"
when:
- openstack_host_sysstat_enabled | bool

View File

@ -0,0 +1,8 @@
# {{ ansible_managed }}
# Run system activity accounting tool every 10 minutes
*/{{ openstack_host_sysstat_interval }} * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at {{ openstack_host_sysstat_statistics_hour }}:59
59 {{ openstack_host_sysstat_statistics_hour }} * * * root /usr/lib64/sa/sa2 -A

View File

@ -56,7 +56,7 @@
register: release_file
- name: Check for systat file
stat:
path: /etc/default/sysstat
path: "{{ openstack_host_sysstat_file }}"
register: systat_file
- name: Check for ssh dir
stat:

View File

@ -15,6 +15,8 @@
## Defined required kernel
openstack_host_required_kernel: 3.10.0-327.13.1.el7.x86_64
openstack_host_sysstat_file: /etc/sysconfig/sysstat
openstack_host_cron_template: sysstat.cron.redhat.j2
## Kernel modules loaded on hosts
openstack_host_kernel_modules:

View File

@ -18,6 +18,8 @@ cache_timeout: 600
## Defined required kernel
openstack_host_required_kernel: 3.13.0-34-generic
openstack_host_sysstat_file: /etc/default/systat
openstack_host_cron_template: sysstat.cron.debian.j2
## Kernel modules loaded on hosts
openstack_host_kernel_modules:

View File

@ -18,6 +18,8 @@ cache_timeout: 600
## Defined required kernel
openstack_host_required_kernel: 4.2.0-18-generic
openstack_host_sysstat_file: /etc/default/systat
openstack_host_cron_template: sysstat.cron.debian.j2
## Kernel modules loaded on hosts
openstack_host_kernel_modules: