I'm trying out custom functions in puppet for the first time to write some simple helper functions for my manifests. I put the code in {my_module}/lib/parser/functions/myhelper.rb, but if I understand correctly you need to enable pluginsync and it doesn't look like vagrant supports that (I tried passing --pluginsync to puppet.options, but it didn't work).
Is there any way to use custom functions in Vagrant?
EDIT: My vagrant box is using puppet 2.7.18
Custom functions should "just" work under vagrant, no need to enable any pluginsync,
I think your problem is the function path, it should be:
{my_module}/lib/puppet/parser/functions/myhelper.rb
Related
One thing that I really like about behave ( https://behave.readthedocs.io/en/stable/ ) is that you can use the stage flag and it will run different step implementations for each one. If you pass the flag --stage=ui, then all step implementations inside ui_steps will run.
I don't want to be stuck with behave, but I didn't see this feature in other runner ( like cucumber.js or even cucumber for java)
Any ideia on how to implement this?
I believe this is possible in cucumberjs. You can pass the location of step deps for cucumber runner. If you have step definitions in separate folders for api and ui tests, you can change your configuration accordingly in your npm script or configuration of the automation tool being used.
You can have two sets of support code and specify which to use via the CLI with --require. Like many things this is easier to manage using profiles.
Aslak (the creator of Cucumber) has a good talk where he is doing something similar to this, using different support code against the same features and steps to test different parts of the stack:
https://www.youtube.com/watch?v=sUclXYMDI94
I am developing opensouce project with a huge pile of dependencies, and I find Puppet a perfect tool for my requirements.
However, my target audience is not necessarily experienced with Puppet. To the point they may not be even know how web servers work. So I would like to ask the user to “run this in terminal” for the simplest case, but if the user also wants to configure some parts of my software, he would have to learn puppet. And educating them Puppet defeats the “servers for dummies” purpose of my project.
Basically, dare I say, I need Unity from the deployment world.
The thing I came up with, is to use ‘json’ as a backend for Puppet, and then write some GUI tool that would generate/modify that json using JSON Schema. Of couse, this thing will be optional and experient Puppet usets could still just use my module as is.
The questiond is, am I doing it right? Is there a solution for my problem?
Thanks in advance.
You can use Hieradata to give the ability to users to configure some parts for your "Software". you can put your hiera configuration in a git repository or build a tool to edit & update this hiera configuration.
There is some tools that you can use in order to make more easier for your users like Foreman and Puppetboard
But I think it's mandatory for your users to have a basic knowledge of Puppet so they can debug or manipulate the software.
These are some things that you can use.
Have a look at these:-
https://puphpet.com/
https://github.com/voxpupuli/puppetboard
I have a web application that I am trying to push to Heroku that relies largely on calling an Octave script. For development/testing, I am using an EC2 instance and node.js. On the EC2 instance I have installed Octave.
However when I push to Heroku and try to call this octave script (via ajax call), I get this error:
https://devcenter.heroku.com/articles/error-codes#h13-connection-closed-without-response
I read that Heroku runs on AWS instances, so I am assuming that it is possible to somehow call an Octave script, since I have done it on my own EC2 instance.
Scattered documentation makes me think that I will have to tell Heroku to install Octave when I push to Heroku, but I am not sure how to do this. Would it be in the node start script (and if so, how)? Or is it something else that I am missing?
EDIT: I am thinking it may instead have to be done through the Heroku buildpack -- can anybody confirm this?
EDIT 2: I think the answer is that I need an Octave buildpack, similar to:
https://github.com/virtualstaticvoid/heroku-buildpack-r
but for Octave instead of R. It looks like one does not exist so I will try my hand at making a custom buildpack.
Yes, you have to use a buildpack. I made one that allows you to run Octave scripts:
https://github.com/wclark3/heroku-buildpack-octave-dynare
It also includes Dynare, a macro-modeling package. So if you come across this answer and you only need Octave, just fork the repo and take out the lines that include Dynare from bin/compile.
I'm working on extending the puppetlabs-mongodb module to allow for user authentication. The challenge is that mongo changed its mechanism for enabling user authentication between version 2.2 and version 2.4 and so distinct code must be run in order to give a user authentication credentials to a database.
My initial thought was to create a custom facter fact that basically captured the output of mongod --version, but it appears that facter facts are loaded before the puppet manifest is executed. Is there a way to execute arbitrary code at run time during puppet execution so that I can access mongod --version and decide which method to use to enable user authentication?
Note: One approach would be to have puppet run a single script to create user credentials and have the script detect the mongod --version at runtime. This doesn't seem like a very puppet-y way of doing things, but perhaps I am off base on that. What is the best way to handle the need for accessing variables dynamically in puppet/facter?
The word from #puppetlabs is that you can not run ruby code (or any other code) dynamically during a puppet run. The "right" way to do this is in the note above with an exec statement that dynamically checks for the mongodb version. For details on the implementation, see manifests/add_user.pp and the associated templates/add_user*.erb.
If anyone has a more "puppety" method for accomplishing this, I'd love to learn about it!
Just put your Ruby code in a ERB template and use template("${module_name}/templ.erb") to return your version string.
I've been doing some work testing web applications with Cucumber and I currently have a number of steps set up to run with Culerity. This works well, but there are times when it would be nice to run the exact same stories in Selenium.
I see two possible approaches that may work:
Writing each step so that it performs the step appropriately depending on the value of some global variable.
Having separate step definition files and somehow selectively including the correct one.
What is the preferred method for accomplishing this?
Third option: See if Culerity implements the Webrat API. Its README file says: "Culerity lets you (...) reuse existing Webrat-Style step definitions". Couldn't find much more than that though. Ideally, you would be able to switch backends with a config option or command-line argument without having to touch the step definitions.
Of course this would only work if you're not testing Javascript, which Culerity supports, but Webrat doesn't.
HI, have you looked at Capybara? It will allow you to use a variety of web drivers, and will allow you to test javascript-related features as well.
I think this is the one you are looking for. http://robots.thoughtbot.com/post/1658763359/thoughtbot-and-the-holy-grail
You can schedule the tests to run in Jenkins. Local machine Jenkins software is open source. You can get cucumber plugin in Jenkins so that you can achieve reporting part to your project on top of continuous test run