Skip to content

Commit

Permalink
Add a note about required bool filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bocharsky-bw committed Aug 28, 2019
1 parent 4cc5d67 commit 6c88c35
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions knpu/when-changed.md
Expand Up @@ -32,6 +32,23 @@ Down below, under "Install Composer's Dependencies", add `when: code_changed`:

[[[ code('acd4c0ebbd') ]]]

***TIP
Ansible does not allow evaluating bare variables anymore. The `code_changed` variable is not
obviously a boolean value because it just references to another variable called `repo_code.changed`,
so Ansible requires the `|bool` filter to be added to the `code_changed` in `when` clauses:

```yaml
---
- hosts: vb
# ...
tasks:
# ...
- name: Install Composer's dependencies
# ...
when: code_changed | bool
```
***

Ah, so nice. Copy that and put it anywhere else it makes sense like "Execute migrations"
and "Clear Cache":

Expand Down

0 comments on commit 6c88c35

Please sign in to comment.