From 5b02908a9f3967f61bfc0205df3388fb2c76c0eb Mon Sep 17 00:00:00 2001 From: Bertrand Lallau Date: Thu, 31 Aug 2017 21:58:44 +0200 Subject: [PATCH] Fix warning during Panko bootstrap task [WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ 'already' not in mongodb_panko_database.stdout }} [WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ mongodb_panko_database.stdout.split()[4] != 'connecting' }} Reason: Ansible 2.3.0 does not like delimiters in when statement. Change-Id: If34130ccf03c0fbadd17eb24fa8e71fbbf2bcd70 Closes-Bug: #1714340 --- ansible/roles/panko/tasks/bootstrap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/panko/tasks/bootstrap.yml b/ansible/roles/panko/tasks/bootstrap.yml index 8b920ba64c..71d3d156ba 100644 --- a/ansible/roles/panko/tasks/bootstrap.yml +++ b/ansible/roles/panko/tasks/bootstrap.yml @@ -3,8 +3,8 @@ command: docker exec -t mongodb mongo --host {{ panko_database_mongodb_address }} --eval 'db = db.getSiblingDB("{{ panko_database_name }}"); db.createUser({user':' "{{ panko_database_user }}", pwd':' "{{ panko_database_password }}", roles':' [ "readWrite", "dbAdmin" ]})' register: mongodb_panko_database run_once: true - changed_when: "{{ 'already' not in mongodb_panko_database.stdout }}" - failed_when: "{{ mongodb_panko_database.stdout.split()[4] != 'connecting' }}" + changed_when: mongodb_panko_database.stdout.find('already') == -1 + failed_when: mongodb_panko_database.stdout.split()[4] != 'connecting' delegate_to: "{{ groups['mongodb'][0] }}" when: - panko_database_type == "mongodb"