You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably obvious to people more used to reading Ansible examples, but the swap file size you provide to this role MUST be a string, e.g., "2048". If you set the parameter to a number, e.g., 2048, the file will always be removed and recreated.
It might be nice to have argument_specs so that this is detected.
The text was updated successfully, but these errors were encountered:
Note for others who may come across this issue; this just bit me even though I thought I was using a string. I set swap_file_size_mb: "{{ ansible_memtotal_mb }}", thinking that because the quotes were there it would be a string. However, because of the quirk of ansible's variable interpolation in YAML, it put it through as a number. You need an explicit string conversion if you want to do this: swap_file_size_mb: "{{ ansible_memtotal_mb | string }}"
In terms of fixing this in the role, I think that the best defensive choice is probably to make sure both things are converted to the same type in the comparison at
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
This is probably obvious to people more used to reading Ansible examples, but the swap file size you provide to this role MUST be a string, e.g., "2048". If you set the parameter to a number, e.g., 2048, the file will always be removed and recreated.
It might be nice to have
argument_specs
so that this is detected.The text was updated successfully, but these errors were encountered: