Difference between revisions of "Install and configure sysstat using Ansible"
Jump to navigation
Jump to search
(13 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | #!/usr/bin/env ansible-playbook | + | #![[/usr/bin/env]] [[ansible-playbook]] |
− | - hosts: YOUR_HOSTNAME | + | - [[hosts:]] YOUR_HOSTNAME |
− | remote_user: YOUR_REMOTEUSER | + | [[remote_user:]] YOUR_REMOTEUSER |
− | become: yes | + | [[become:]] yes |
− | connection: ssh | + | [[connection:]] ssh |
− | tasks: | + | [[tasks:]] |
- name: Install and start as service sysstat for Ubuntu | - name: Install and start as service sysstat for Ubuntu | ||
− | block: | + | [[block:]] |
− | - package: | + | - [[package:]] |
− | name: sysstat | + | name: [[sysstat]] |
− | state: present | + | [[state: present]] |
− | - lineinfile: | + | - [[lineinfile:]] |
− | path: /etc/default/sysstat | + | path: [[/etc/default/sysstat]] |
state: present | state: present | ||
backrefs: yes | backrefs: yes | ||
− | regexp: '^ENABLED="false"' | + | [[regexp]]: '^ENABLED="false"' |
line: 'ENABLED="true"' | line: 'ENABLED="true"' | ||
− | - service: | + | - [[service:]] |
name: sysstat | name: sysstat | ||
state: started | state: started | ||
enabled: yes | enabled: yes | ||
− | when: ansible_distribution == 'Ubuntu' | + | when: [[ansible_distribution]] == 'Ubuntu' |
== 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 == | ||
+ | * <code>[[apt install]]</code> | ||
+ | * [[Installing sysstat using Ansible]] | ||
== See also == | == See also == |
Latest revision as of 08:57, 6 February 2023
#!/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[edit]
- 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[edit]
See also[edit]
- Configure user to be able to use sudo with no password
- Ansible modules:
gather_facts, set_fact
,ansible.builtin.file
,lineinfile
,stat
,group
,mount
,git:
,package:
,command:
,shell:
,raw:
,template:
,register:
,user:
, Ansible playbooks examples,tasks:
,lineinfile, blockinfile:
,shell:
,command:
,raw:
,ansible.builtin.file, service:, aws.ecs_taskdefinition, aws.asg, docker_container, kubernetes.core.k8s
,community.
,include_tasks
- Ansible: modules, plugins, Playbooks (examples)
ansible-playbook
,ansible-vault
,ansible-inventory
,ansible-config
, Ansible Tower, Ansible Galaxy (Roles) (ansible-galaxy
),ansible-cmdb
,gather facts
,ansible.cfg
,Ansible Molecule
, Ansible collections,register
,template
,--ask-pass
,--ask-become-pass
,remote_user:
,/etc/ansible/hosts
,ansible-doc
,ansible-lint
,.ansible/
,--forks
,--start-at-task
,changelog
,inventory
,Notify:
,ansible HOSTNAME -m ping
,gathering
,/usr/bin/ansible
,ansible -m ping
,ansible.builtin
,hosts: (Ansible)
,set fact:
,when:
,blockinfile:
,become method:
,include:
,git:
, AWX,ansible --help
, Tags, Ansible variables, versions
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: