3

I have tried making REST calls with puppet and it was... well... awful. I didn't really want to use pure ruby to interact with my load balancer and my concern was that for REST calls, every time the puppet run occurs I would be idempotently slamming my web server with a ton of requests - first checking if a particular item is out of spec and then possibly resetting it. Using curl via an exec and an unless statement was arduous to say the least.

Furthermore, the idempotent philosophy of puppet doesn't always play well with REST APIs that are not idempotent.

Are there any simple ways, ready-made methods or plugins for dealing with REST APIs via puppet?

Note: one feature request to watch: https://tickets.puppetlabs.com/browse/PUP-6658?filter=-2

2
  • You do Puppet and then you rest... Commented May 20, 2017 at 4:00
  • A REST API must be idempotent by definition, if it is not, it's just a HTTP API (a little pedantic but let's be precise here)
    – Tensibai
    Commented May 20, 2017 at 20:34

1 Answer 1

1

While it may not be the answer you are looking for, puppet's DSL lacks verbs on purpose. Puppet's idempotent philosophy is a huge reason it is so useful for some use cases but for this type of need you will want to use a tool which is more targeted to that role.

When you hit limitations due to the idempotent philosophy of Puppet it is a good indication that another tool is required for that need.

I would look for publicly maintained tools for the task maybe in Ansible or Terraform.

We leveraged the "puppet kick" functionality of puppet and then tried to extend it after it was deprecated and the pain of trying to ignore their design philosophy is an expensive one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.