-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Install WP-CLI packages #837
Conversation
Looks good to me! |
roles/wp-cli/tasks/main.yml
Outdated
@@ -23,3 +23,10 @@ | |||
warn: false | |||
register: wp_cli_completion | |||
changed_when: wp_cli_completion.stdout == 'wp-completion-' + wp_cli_version + '.bash' | |||
|
|||
- name: Install WP-CLI packages | |||
command: "wp package install {{ item }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: double quotes are only necessary if the {{ jinja }}
begins the variable value, so this could just be
- command: "wp package install {{ item }}"
+ command: wp package install {{ item }}
I realize Trellis is not always consistent on this, but the general goal has been to use quotes only when absolutely needed.
roles/wp-cli/tasks/main.yml
Outdated
command: "wp package install {{ item }}" | ||
become_user: "{{ web_user }}" | ||
register: wp_cli_packages_installed | ||
changed_when: "'Nothing to install or update' not in wp_cli_packages_installed.stdout" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While testing, I noticed that in some cases stdout
for already-installed packages did not include 'Nothing to install or update'
but instead included 'Package operations: 0 installs, 0 updates, 0 removals'
. This meant that sometimes Ansible inaccurately reported changed
for packages that were already installed.
How does this modification look to you?
- changed_when: "'Nothing to install or update' not in wp_cli_packages_installed.stdout"
+ changed_when:
+ - "'Nothing to install or update' not in wp_cli_packages_installed.stdout"
+ - "'Package operations: 0 installs, 0 updates, 0 removals' not in wp_cli_packages_installed.stdout"
I would have preferred to be more concise by checking for a string that is unique to when packages are freshly installed but I didn't observe any such string.
09ecc9a
to
77d00cd
Compare
thank you! |
* master: (120 commits) Reload Nginx with updates to manual cert or key (roots#843) Add self signed certificates subdomains (roots#812) Add support for SMTP without authentication Remove output about running WP-CLI and Composer Option to install WP-CLI packages (roots#837) Update WP theme paths only when template_root in releases_path (roots#840) Update wp-cli to 1.2.1 (roots#838) skip plugins with WP-CLI, to avoid crappy plugins breaking deploys Add options for sources and version Add re-run vagrant up message Remove plugins from README Auto-install Vagrant plugins Fixes Add Vagrant config support Use python slice on password salt instead of Jinja2 truncate() Avoid single var containing jinja delimiters in when parameter Remove jinja delimiters from tasks' when parameter Update connection test for new dense.py callback in Ansible 2.3 Deploys: Make wp core update-db optional (roots#827) Use a block ... # Conflicts: # Vagrantfile # ansible.cfg
No description provided.