Fix Creating Panko MongoDB database failed
The check whether 'already' presents in mongodb output should belong to changed_when. Change-Id: I829c8906f0f7b61d3f6e0211319899d126e6850c Closes-Bug: #1668216
This commit is contained in:
parent
ef34e2a1c5
commit
ab3bdd8aac
@ -3,9 +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
|
||||
failed_when:
|
||||
- "'already' not in mongodb_panko_database.stdout"
|
||||
- mongodb_panko_database.stdout.split()[4] != 'connecting'
|
||||
changed_when: "{{ 'already' not in mongodb_panko_database.stdout }}"
|
||||
failed_when: "{{ mongodb_panko_database.rc != 0 or mongodb_panko_database.stdout.split()[4] != 'connecting' }}"
|
||||
delegate_to: "{{ groups['mongodb'][0] }}"
|
||||
when:
|
||||
- panko_database_type == "mongodb"
|
||||
|
Loading…
Reference in New Issue
Block a user