geerlingguy / ansible-role-redis

Ansible Role - Redis
https://galaxy.ansible.com/geerlingguy/redis/
MIT License
254 stars 197 forks source link

dynamic redis package name #10

Closed leventyalcin closed 8 years ago

leventyalcin commented 8 years ago

This make easier to set up redis from external repositories such as IUS etc.

geerlingguy commented 8 years ago

I haven't tested with Ansible 1.9.x or 2.x with the included vars files—but I believe variable precedence would make it difficult to override the package name in an upstream playbook... or have you tested and found otherwise? In the past, I've done things like this: https://github.com/geerlingguy/ansible-role-php/blob/master/vars/Debian.yml#L14 / https://github.com/geerlingguy/ansible-role-php/blob/master/tasks/main.yml#L13

leventyalcin commented 8 years ago

You're right. I only run the role but didn't check the version of redis. It was the wrong one. Now, It's working as expected.

leventyalcin commented 8 years ago

Ping

seeafish commented 8 years ago

@leventyalcin I did a fork to achieve pretty much the same thing, but for the repo name (we used custom name for repos). Not sure if @geerlingguy is maintaining this still, but could I suggest you adding a var for redis_yum_repo or something? Thanks.

leventyalcin commented 8 years ago

Hi @seeafish,

It could be nice but I'm not sure if @geerlingguy wants to add that.

To me, I'd like to keep repositories at the same place and I'm usually managing repositories something like https://github.com/AerisCloud/ansible-repos It makes easy to understand what repositories you're using and I think it's a bit more flexible when you're trying to set priority between repositories.

Thanks,

seeafish commented 8 years ago

Hi @leventyalcin.

The issue I have is that this playbook does enablerepo=epel when it installs the package, but the particular servers I use might have custom-name-epel, which requires me to customise the repo name in the playbook. Bit of an edge case I know, but I think it's good to use vars regardless. I'll work off my fork.

leventyalcin commented 8 years ago

Hi @seeafish,

I think it's good to have that flexibility, though.

I can suggest using yum-plugin-priorities If you're using any role to manage repositories and if it is not causing any conflict/problem (installing any other package etc).

geerlingguy commented 8 years ago

Almost ready to merge this, thanks for your work on this!