Skip to content

Conversation

@tjanez
Copy link

@tjanez tjanez commented Nov 3, 2014

Ansible checks if the version of Redis is 2.8.x and uses a different
configuration template if it is.

Ansible checks if the version of Redis is 2.8.x and uses a different
configuration template if it is.
@bennojoy
Copy link
Owner

bennojoy commented Nov 4, 2014

Hi ,

Could you please split the task into two , eventhough the below is a valid jinja, we dont encourage usning conditionals within the {{ }}.

  • name: Copy the Redis configuration file
  • template: src={{ "redis-2.8.conf.j2" if redis_version.stdout | search("v=2.8") else "redis.conf.j2" }} dest={{ redis_conf_dest }}

so the task woudl have

template: src=redis-2.8.conf.j2
when:redis_version.stdout | search("v=2.8")

Similarly for the other pr also please.

@tjanez
Copy link
Author

tjanez commented Nov 5, 2014

Sure, no problem. I'll update both PRs.

This was done to avoid using Jinja2's conditionals in the playbook, which is
discouraged.
@tjanez
Copy link
Author

tjanez commented Nov 7, 2014

@bennojoy, I updated the PR. Please, review.

@tjanez
Copy link
Author

tjanez commented Dec 2, 2014

@bennojoy, ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants