-update swap file size for pi's - use dphys-swapfile

This commit is contained in:
Pi
2019-03-29 09:13:54 -04:00
parent e83720a1c3
commit f9dbca34d9
4 changed files with 22 additions and 4 deletions

View File

@@ -17,6 +17,7 @@
- wifi
- vnc
- domainname
- pi
vars_prompt:
- name: rocommunity
prompt: "Enter SNMP RO community name"

View File

@@ -2,10 +2,10 @@
- name: enable cron job for ftp traffic
cron:
name: "ftptraff"
minute: "*/60"
hour: "7-18"
minute: "0"
hour: "7-18/2"
weekday: "1-5"
job: "/usr/bin/perl -e 'sleep int rand 3599' && /home/pi/scripts/ftp-session.sh"
job: "/usr/bin/perl -e 'sleep int rand 7199' && /home/pi/scripts/ftp-session.sh"
tags: ftptraff_cron
- name: copy ftp-session.sh to scripts directory
copy:

17
roles/pi/tasks/main.yaml Executable file
View File

@@ -0,0 +1,17 @@
---
- name: set swapfile
become: true
lineinfile:
path: /etc/dphys-swapfile
state: present
regexp: '^CONF_SWAPSIZE'
line: 'CONF_SWAPSIZE=1024'
owner: root
group: root
mode: 0600
tags: set_swapfile
- name: restart swapfile
become: true
command: '/etc/init.d/dphys-swapfile restart'
tags: set_swapfile

View File

@@ -1,2 +1,2 @@
#/bin/bash
#!/bin/bash
echo "q" >/dev/udp/127.0.0.1/8888