Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redisget() #179

Merged
merged 1 commit into from May 3, 2017
Merged

Add redisget() #179

merged 1 commit into from May 3, 2017

Conversation

ghoneycutt
Copy link
Member

Add the redisget() function which can get a value for a specified key
from a specified redis URL.

Add the redisget() function which can get a value for a specified key
from a specified redis URL.
@petems
Copy link
Member

petems commented May 3, 2017

@ghoneycutt This is very cool! Let me have a look, I might add and acceptance test also, but otherwise this seems like an awesome addition 👍

@petems petems merged commit 05869f2 into voxpupuli:master May 3, 2017
@ghoneycutt
Copy link
Member Author

Thanks, glad you like it. These tests were a pain :>

Could you please tag a new release?

ghoneycutt added a commit to ghoneycutt/puppet-redis that referenced this pull request May 3, 2017
Add the redisget() function which can get a value for a specified key
from a specified redis URL.
@ghoneycutt ghoneycutt deleted the redisget branch May 3, 2017 13:53
@petems
Copy link
Member

petems commented May 3, 2017

Will do when the acceptance tests are merged 👍

@petems
Copy link
Member

petems commented May 3, 2017

@ghoneycutt BTW do you have some example usecases of how you're using this right now in your Puppet code you can share?

It'd be a good bit of background for the README, also thinking about adding a redisset() command in Puppet also, but that might not be so great for idempotency

@arioch
Copy link
Contributor

arioch commented May 3, 2017

@petems How does this work with the Forge? Do you have publish access on my account?
If not how do we fix this...

@petems
Copy link
Member

petems commented May 3, 2017

@arioch opened an issue #185

@ghoneycutt
Copy link
Member Author

I have a CD pipeline for a piece of software that records the version of a successful build in our source of truth (Redis). To know what version should be installed, I use redisget() similar to the example in the README and use that in my package resource.

Another use case is similar to Consul for service discovery. You can set that information in Redis using a process outside of Puppet and then have Puppet query that to know what information to use in your configuration.

A more detailed piece of code might look like

class profile::myapp {
  $redis_url = hiera('redis_url')

  $version = redisget("version.myapp.${::environment}", $redis_url)

  package { 'myapp':
    ensure => $version,
  }
}

@ghoneycutt
Copy link
Member Author

I don't have a use case for Puppet to set data in Redis as I'm using Redis as source of truth to be queried. I don't really see a use case to write data there with Puppet. Suggest holding off on writing additional functions until someone actually needs them, even if they are trivial to implement.

@petems
Copy link
Member

petems commented May 3, 2017

Yep, all makes sense 👍

I'll hold fire until someone asks for something like that, but seems like a cool usecase 😄

@v6
Copy link

v6 commented May 17, 2017

// , This doesn't break compatibility with CEntOS 6's Ruby 1.8.7, correct?

@ghoneycutt
Copy link
Member Author

@v6 I'm using it in a Puppet v3 / Ruby 1.8.7 environment

cegeka-jenkins pushed a commit to cegeka/puppet-redis that referenced this pull request Feb 16, 2021
Add the redisget() function which can get a value for a specified key
from a specified redis URL.
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.

None yet

4 participants