Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
As configured in my dotfiles.
start new:
tmux
start new with session name:
| --- | |
| - hosts: test | |
| roles: | |
| - ansible-role-security | |
| post_tasks: | |
| - name: ensure fail2ban starts on a fresh reboot | |
| service: | |
| name: fail2ban | |
| state: started | |
| enabled: yes | 
| --- | |
| - hosts: localhost | |
| gather_facts: no | |
| become: true | |
| become_user: root | |
| become_method: sudo | |
| tasks: | |
| - add_host: | |
| name: "{{ target_host }}" | 
| --- | |
| - hosts: localhost | |
| gather_facts: no | |
| become: true | |
| become_user: root | |
| become_method: sudo | |
| vars: | |
| - target_host: '' | |
| tasks: | 
| #!/bin/bash | |
| # get free memory | |
| IFS=" " read USED FREE TOTAL <<<$(free -htm | grep "Mem" | awk {'print $3,$4,$2'}) | |
| # get processes | |
| PROCESS=`ps -eo user=|sort|uniq -c | awk '{ print $2 " " $1 }'` | |
| PROCESS_ALL=`echo "$PROCESS"| awk {'print $2'} | awk '{ SUM += $1} END { print SUM }'` | |
| PROCESS_ROOT=`echo "$PROCESS"| grep root | awk {'print $2'}` | |
| PROCESS_USER=`echo "$PROCESS"| grep -v root | awk {'print $2'} | awk '{ SUM += $1} END { print SUM }'` |