Do less things for root and sudo'ers
When this role is run for root
or users in the sudo
group it does too much and then fails:
ASK [users : Users PHP FPM pool.d file absent] **********************************************************************************************************************************************************
fatal: [wsh.webarchitects.org.uk]: FAILED! => {"msg": "The conditional check '( item.value.users_state is defined and item.value.users_state == \"absent\" ) or ( \"phpfpm\" not in item.value.users_groups or \"chroot\" not in item.value.users_groups )' failed. The error was: error while evaluating conditional (( item.value.users_state is defined and item.value.users_state == \"absent\" ) or ( \"phpfpm\" not in item.value.users_groups or \"chroot\" not in item.value.users_groups )): Unable to look up a name or access an attribute in template string ({% if ( item.value.users_state is defined and item.value.users_state == \"absent\" ) or ( \"phpfpm\" not in item.value.users_groups or \"chroot\" not in item.value.users_groups ) %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': argument of type 'StrictUndefined' is not iterable\n\nThe error appears to have been in 'galaxy/roles/users/tasks/phpfpm_chroot.yml': line 60, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Users PHP FPM pool.d file absent\n ^ here\n"}