diff --git a/roles/1-prep/tasks/raspberry_pi.yml b/roles/1-prep/tasks/raspberry_pi.yml index 22efe6934..11b23e651 100644 --- a/roles/1-prep/tasks/raspberry_pi.yml +++ b/roles/1-prep/tasks/raspberry_pi.yml @@ -32,12 +32,12 @@ name: ntp state: latest -- name: Increase swap file size (to CONF_SWAPSIZE=500 in /etc/dphys-swapfile) as kalite pip download fails (debuntu) +- name: Increase swap file size (to CONF_SWAPSIZE={{ pi_swap_file_size }} in /etc/dphys-swapfile) as kalite pip download fails (debuntu) lineinfile: path: /etc/dphys-swapfile regexp: "^CONF_SWAPSIZE" - line: CONF_SWAPSIZE=500 - when: is_debuntu | bool + line: "CONF_SWAPSIZE={{ pi_swap_file_size }}" + when: is_debuntu | bool # Redundant, given raspberry_pi.yml is only run when rpi_model: "rpi" (similar to is_rpi: True). Until someone tries a non-debuntu OS on RPi? - name: Restart swap service "dphys-swapfile" (debuntu) #command: /etc/init.d/dphys-swapfile restart diff --git a/vars/default_vars.yml b/vars/default_vars.yml index bd11ba271..8d3400a65 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -198,6 +198,10 @@ openvpn_server_port: 1194 # need_ncat is turned true by os-#.yml files that don't have ncat in nmap need_ncat: False +# Some prefer 512MB for Zero W, others prefer 2048MB or higher for RPi 3 and 4. +# Please see recommendations at: https://itsfoss.com/swap-size/ +pi_swap_file_size: 1024 + # 2-COMMON diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index bc6293501..2b5ce6171 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -102,6 +102,10 @@ openvpn_handle: # The following seems necessary on CentOS: # openvpn_cron_enabled: True +# Some prefer 512MB for Zero W, others prefer 2048MB or higher for RPi 3 and 4. +# Please see recommendations at: https://itsfoss.com/swap-size/ +pi_swap_file_size: 1024 + # 2-COMMON diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index c99c2ac9e..d03e5ce42 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -102,6 +102,10 @@ openvpn_handle: # The following seems necessary on CentOS: # openvpn_cron_enabled: True +# Some prefer 512MB for Zero W, others prefer 2048MB or higher for RPi 3 and 4. +# Please see recommendations at: https://itsfoss.com/swap-size/ +pi_swap_file_size: 1024 + # 2-COMMON diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index c9e76bbe5..e93148cd6 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -102,6 +102,10 @@ openvpn_handle: # The following seems necessary on CentOS: # openvpn_cron_enabled: True +# Some prefer 512MB for Zero W, others prefer 2048MB or higher for RPi 3 and 4. +# Please see recommendations at: https://itsfoss.com/swap-size/ +pi_swap_file_size: 1024 + # 2-COMMON