Fix fact set using ternary filter

When the set_fact module is used with the ternary filter the evaluated
condition must be surrounded in parentheses, otherwise the fact will
always be set to False.

While other uses of ternary within this role don't seem to be effected,
update them also for consistency and readability.

Change-Id: I4809ded8b6fe738f8fa700434739ee0b1f6d3af1
(cherry picked from commit 2f68deee89)
This commit is contained in:
Jimmy McCrory 2017-02-28 10:31:19 -08:00 committed by Jesse Pretorius
parent 7908490894
commit ba449a719e
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@
apt_repository:
repo: "{{ galera_percona_xtrabackup_repo.repo }}"
filename: "{{ galera_percona_xtrabackup_repo.filename | default(omit) }}"
state: "{{ use_percona_upstream | bool | ternary('present','absent') }}"
state: "{{ (use_percona_upstream | bool) | ternary('present','absent') }}"
register: add_repos
until: add_repos|success
retries: 5

View File

@ -15,7 +15,7 @@
- name: Set fact for extra arguments in MySQL commands
set_fact:
mysql_extra_args: "{{ ansible_os_family == 'Debian' | ternary('--defaults-file=/etc/mysql/debian.cnf', '') }}"
mysql_extra_args: "{{ (ansible_os_family == 'Debian') | ternary('--defaults-file=/etc/mysql/debian.cnf', '') }}"
tags:
- galera-cluster-state-check
- galera-bootstrap