--- - name: Get nofiles limit become: true # NOTE: `ulimit` is a shell builtin so we have to invoke it like this: command: sh -c "ulimit -n" register: nofilesval changed_when: false - name: Check nofiles limit fail: msg: > nofiles is set to {{ nofilesval.stdout }}. It should be at least {{ nofiles_min }} or higher, depending on available resources. failed_when: "nofilesval.stdout|int < nofiles_min" - name: Get nproc limit become: true # NOTE: `ulimit` is a shell builtin so we have to invoke it like this: command: sh -c "ulimit -u" register: nprocval changed_when: false - name: Check nproc limit fail: msg: > nproc is set to {{ nprocval.stdout }}. It should be at least {{ nproc_min }} or higher, depending on available resources. failed_when: "nprocval.stdout|int < nproc_min"