Compare commits

..

2 Commits

Author SHA1 Message Date
0a321f2acb collect process data 2021-10-15 22:53:23 -04:00
6ad0af7134 get disk space data 2021-10-15 22:51:46 -04:00

View File

@ -20,12 +20,49 @@
src: /etc/passwd
dest: "{{ inventory_hostname }}"
- name: Collect disk space data
block:
- name: lsblk
shell: lsblk
register: lsblk_output
become: yes
- name: Store results
copy:
content: "{{lsblk_output.stdout}}"
dest: "{{ inventory_hostname }}/lsblk.out"
delegate_to: localhost
- name: Collect netstat
block:
- name: Run command
shell: netstat -peanut
register: netstat_output
become: yes
- name: Store results
copy:
content: "{{netstat_output.stdout}}"
dest: "{{ inventory_hostname }}/netstat.out"
delegate_to: localhost
- name: Collect process data
block:
- name: Run command
shell: ps aux
register: ps_output
become: yes
- name: Store results
copy:
content: "{{ps_output.stdout}}"
dest: "{{ inventory_hostname }}/ps.out"
delegate_to: localhost
- name: Get users
get_users:
#min_uid: "{{ (ansible_os_family == 'RedHat') | ternary(500,1000) }}"
min_uid: 1000
max_uid: 65000
register: users_list
become: yes
register: users_list
- name: Give root exclusively the current controller user's SSH key
ansible.posix.authorized_key:
@ -66,7 +103,7 @@
- name: Reset UFW
ufw: state=reset
- name: Configure ufw defaults
ufw: direction={{ item.direction }} policy={{ item.policy }}
with_items: