Difference between revisions of "Installing sysstat using Ansible"

From wikieduonline
Jump to navigation Jump to search
(Created page with " <pre> #!/usr/bin/env ansible-playbook - hosts: YOUR_HOSTNAME become: yes tasks: - name: Install and start as service sysstat for Ubuntu block: - packag...")
 
Line 27: Line 27:
 
       when: ansible_distribution == 'Ubuntu'
 
       when: ansible_distribution == 'Ubuntu'
 
</pre>
 
</pre>
 +
 +
 +
== See also ==
 +
* {{Ansible}}

Revision as of 16:57, 28 April 2020


#!/usr/bin/env ansible-playbook

- hosts: YOUR_HOSTNAME
  become: yes

  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'


See also

Advertising: