Skip to content

webarch-coop/ansible-role-wpcli

Repository files navigation

Webarchitects Ansible WordPress Command Line Interface (WP-CLI) Role

pipeline status

This repository contains an Ansible role for installing and upgrading WP-CLI on Debian and Ubuntu servers.

Role Variables

There are eleven default variables, set wpcli to true for the tasks in this role to be run, the other defaults should only need changing if this role isn't run as root.

See the defaults/main.yml for the role defaults and VARIABLES.md file for documentation automatically generated from the meta/argument_specs.yml for all the role variables.

Example Usage

This role can also be used with the localhost repo to install WP-CLI locally, see also the WordPress role.

Include this role and run it as root:

- name: Include wpcli role as root
  ansible.builtin.include_role:
    name: wpcli
  vars:
    wpcli: true

Include this role and run it as a non-root user:

- name: Include wpcli role as the foo user
  ansible.builtin.include_role:
    name: wpcli
  vars:
    wpcli: true
    wpcli_owner: "foo"
    wpcli_bin: "/home/foo/.local/bin"
    wpcli_download_dir: "/home/foo/tmp"
    wpcli_bash_completion_dir: "/home/foo/.bash_completion.d"

Repository

The primary URL of this repo is https://git.coop/webarch/wpcli however it is also mirrored to GitHub and available via Ansible Galaxy.

See the GitLab releases page for details regarding each version, please use a specific version since the master branch is used for development.

Copyright

Copyright 2018-2024 Chris Croome, <[email protected]>.

This role is released under the same terms as Ansible itself, the GNU GPLv3.