Difference between revisions of "Install and configure sysstat using Ansible"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 29: Line 29:
 
== Activities ==
 
== Activities ==
 
# Modify [[Ansible]] playbook to include a parameters for modifying default collection interval and collection options: <code>SADC_OPTIONS="-S XALL"</code> in <code>/etc/sysstat/[[sysstat]]</code> (man sadc for more options)
 
# Modify [[Ansible]] playbook to include a parameters for modifying default collection interval and collection options: <code>SADC_OPTIONS="-S XALL"</code> in <code>/etc/sysstat/[[sysstat]]</code> (man sadc for more options)
 +
 +
 +
== Related terms ==
 +
* <code>[[apt install]]</code>
  
 
== See also ==
 
== See also ==

Revision as of 05:45, 27 July 2021

#!/usr/bin/env ansible-playbook 

- hosts: YOUR_HOSTNAME
  remote_user: YOUR_REMOTEUSER 
  become: yes
  connection: ssh

  tasks:
    - name: Install and start as service sysstat for Ubuntu 
      block:
      - package:
          name: sysstat
          state: present	

      - lineinfile:
          path: /etc/default/sysstat
          state: present
          backrefs: yes
          regexp: '^ENABLED="false"'
          line: 'ENABLED="true"'

      - service:
          name: sysstat
           state: started
          enabled: yes
      when: ansible_distribution == 'Ubuntu'

Activities

  1. Modify Ansible playbook to include a parameters for modifying default collection interval and collection options: SADC_OPTIONS="-S XALL" in /etc/sysstat/sysstat (man sadc for more options)


Related terms

See also


Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Source: wikiversity

Advertising: