From: Matt Birkholz Date: Thu, 20 Nov 2025 23:44:41 +0000 (-0700) Subject: Replace "become_user: www-data" with sudo in Nextcloud playbooks. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9900555a9345558b9b9a154363e845ebb9bd94d7;p=Institute Replace "become_user: www-data" with sudo in Nextcloud playbooks. Follow the (debugged?) example of playbooks/nextcloud-new.yml. --- diff --git a/README.org b/README.org index 6993612..4a686c4 100644 --- a/README.org +++ b/README.org @@ -6482,12 +6482,12 @@ users:resetpassword~ command. tasks: - name: Run occ user:resetpassword. become: yes - become_user: www-data shell: chdir: /var/www/nextcloud/ cmd: > - OC_PASS={{ pass }} - php occ user:resetpassword {{ user }} --password-from-env + sudo -u www-data sh -c + "OC_PASS={{ pass }} + php occ user:resetpassword {{ user }} --password-from-env" #+END_SRC *** Installing the Less Aggressive passwd @@ -6586,10 +6586,11 @@ if (defined $ARGV[0] && $ARGV[0] eq "old") { tasks: - name: Run occ user:disable. become: yes - become_user: www-data shell: chdir: /var/www/nextcloud/ - cmd: php occ user:disable {{ user }} + cmd: > + sudo -u www-data sh -c + "php occ user:disable {{ user }}" #+END_SRC ** The Client Command diff --git a/playbooks/nextcloud-old.yml b/playbooks/nextcloud-old.yml index 6d1df1e..4077abf 100644 --- a/playbooks/nextcloud-old.yml +++ b/playbooks/nextcloud-old.yml @@ -2,7 +2,8 @@ tasks: - name: Run occ user:disable. become: yes - become_user: www-data shell: chdir: /var/www/nextcloud/ - cmd: php occ user:disable {{ user }} + cmd: > + sudo -u www-data sh -c + "php occ user:disable {{ user }}" diff --git a/playbooks/nextcloud-pass.yml b/playbooks/nextcloud-pass.yml index 4a38955..46f1022 100644 --- a/playbooks/nextcloud-pass.yml +++ b/playbooks/nextcloud-pass.yml @@ -3,9 +3,9 @@ tasks: - name: Run occ user:resetpassword. become: yes - become_user: www-data shell: chdir: /var/www/nextcloud/ cmd: > - OC_PASS={{ pass }} - php occ user:resetpassword {{ user }} --password-from-env + sudo -u www-data sh -c + "OC_PASS={{ pass }} + php occ user:resetpassword {{ user }} --password-from-env"