- hosts: core tasks: - name: Run occ user:disable. shell: | spawn sudo -u www-data /usr/bin/php occ user:disable {{ user }} expect { "The specified user is disabled" {} timeout { exit 1 } } args: chdir: /var/www/nextcloud/ executable: /usr/bin/expect