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:
@@ -13,13 +13,20 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable sysstat
|
- name: Enable sysstat config
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "sysstat.default.j2"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ openstack_host_sysstat_file }}"
|
||||||
mode: "{{ item.mode|default('0644')}}"
|
mode: "0644"
|
||||||
with_items:
|
when:
|
||||||
- { src: "sysstat.default.j2", dest: "/etc/default/sysstat" }
|
- openstack_host_sysstat_enabled | bool
|
||||||
- { src: "sysstat.cron.j2", dest: "/etc/cron.d/sysstat", mode: "0755" }
|
- ansible_os_family == "Debian"
|
||||||
when: openstack_host_sysstat_enabled | bool
|
|
||||||
notify: Restart sysstat
|
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
|
||||||
|
8
templates/sysstat.cron.redhat.j2
Normal file
8
templates/sysstat.cron.redhat.j2
Normal 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
|
@@ -56,7 +56,7 @@
|
|||||||
register: release_file
|
register: release_file
|
||||||
- name: Check for systat file
|
- name: Check for systat file
|
||||||
stat:
|
stat:
|
||||||
path: /etc/default/sysstat
|
path: "{{ openstack_host_sysstat_file }}"
|
||||||
register: systat_file
|
register: systat_file
|
||||||
- name: Check for ssh dir
|
- name: Check for ssh dir
|
||||||
stat:
|
stat:
|
||||||
|
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
## Defined required kernel
|
## Defined required kernel
|
||||||
openstack_host_required_kernel: 3.10.0-327.13.1.el7.x86_64
|
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
|
## Kernel modules loaded on hosts
|
||||||
openstack_host_kernel_modules:
|
openstack_host_kernel_modules:
|
||||||
|
@@ -18,6 +18,8 @@ cache_timeout: 600
|
|||||||
|
|
||||||
## Defined required kernel
|
## Defined required kernel
|
||||||
openstack_host_required_kernel: 3.13.0-34-generic
|
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
|
## Kernel modules loaded on hosts
|
||||||
openstack_host_kernel_modules:
|
openstack_host_kernel_modules:
|
||||||
|
@@ -18,6 +18,8 @@ cache_timeout: 600
|
|||||||
|
|
||||||
## Defined required kernel
|
## Defined required kernel
|
||||||
openstack_host_required_kernel: 4.2.0-18-generic
|
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
|
## Kernel modules loaded on hosts
|
||||||
openstack_host_kernel_modules:
|
openstack_host_kernel_modules:
|
||||||
|
Reference in New Issue
Block a user