Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP cli fail due when running as root #37

Open
martinjobb opened this issue May 24, 2021 · 1 comment
Open

WP cli fail due when running as root #37

martinjobb opened this issue May 24, 2021 · 1 comment
Assignees

Comments

@martinjobb
Copy link
Contributor

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
@saraojelind
Copy link
Member

"--allow-root" was removed in the commit 28a6a8e, 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants