Skip to content

Instantly share code, notes, and snippets.

@mingderwang
Created November 17, 2019 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingderwang/2fd238bac4871f75e3ed31386256b3f3 to your computer and use it in GitHub Desktop.
Save mingderwang/2fd238bac4871f75e3ed31386256b3f3 to your computer and use it in GitHub Desktop.
to run ansible on server itself to test performance and spec
---
- hosts: localhost
sudo: yes
tasks:
# gathering fact on remote server.
- name: Collect only facts returned by facter
setup:
gather_subset:
- 'virtual'
register: version
- debug: var=version
- name: performance test 1 - top
shell: top -bcn 1 -w888
- name: performance test 2 - iostat
shell: iostat -tkdx 1 10
- name: 系統負載請用以下的命令
shell: sar -ud 1 10
- name: show system storage
shell: cat /etc/fstab && df -k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment