Frojd-Bedrock
Frojd-Bedrock copied to clipboard
WP cli fail due when running as root
These commands fails with YIKES! It looks like you're running this as root.
- name: Flush permalinks
shell: chdir="{{ ansistrano_release_path.stdout }}"
wp rewrite flush
- name: Flush cache
shell: chdir="{{ ansistrano_release_path.stdout }}"
wp cache flush
in after-symlink.yml.
I suggest either to add --allow-root
or the soulution below.
- name: Flush permalinks
shell: chdir="{{ ansistrano_release_path.stdout }}"
runuser -u www-data -- wp rewrite flush
- name: Flush cache
shell: chdir="{{ ansistrano_release_path.stdout }}"
runuser -u www-data -- wp cache flush
"--allow-root" was removed in the commit 28a6a8e3f11b694e6427ee3fe2a6105fc5a45046, since the deploy-user is used instead of root on deploy. I think if any changes are needed for the deployment in a specific project then this can be done manually. @mikaelengstrom do you have any input on the change?