---
# tasks file for wordpress, wp-cli
- name: install (wp-cli)
  get_url:
    url: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
    dest: "{{ wordpress_wp_cli_install_dir }}/wp-cli"
    force: true
    owner: root
    group: root
    mode: 0755
  tags: [configuration, wordpress, wordpress-wp-cli, wordpress-wp-cli-install]

- name: check (wp-cli)
  shell: "wp-cli --allow-root --no-color --info"
  register: check_info
  failed_when: "'WP-CLI' not in check_info.stdout"
  changed_when: False
  tags: [configuration, wordpress, wordpress-wp-cli, wordpress-wp-cli-check]

---
# tasks file for wordpress, wp-cli
- name: install (wp-cli)
  get_url:
    url: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
    dest: "{{ wordpress_wp_cli_install_dir }}/wp-cli"
    force: true
    owner: root
    group: root
    mode: 0755
  tags: [configuration, wordpress, wordpress-wp-cli, wordpress-wp-cli-install]

- name: check (wp-cli)
  command: "wp-cli --allow-root --no-color --info"
  register: check_info
  failed_when: "'WP-CLI' not in check_info.stdout"
  changed_when: False
  tags: [configuration, wordpress, wordpress-wp-cli, wordpress-wp-cli-check]

Make use of command instead of shell
Make use of command instead of shell
