Lets say you are an administrator of an OpenStack cloud. This means you are pretty much all powerful in the deployment. Now, you need to perform some operation, but you don’t want to give it full admin privileges? Why? well, do you work as root on your Linux box? I hope note. Here’s how to set up a self trust for a reduced set of roles on your token.
Continue reading
Category Archives: Software
Converting a RHEL Workstation to a Server
My laptop is my Demo machine. I need to be able to run the Red Hat cloud Suite of software on it. I want to install this software the same way a customer would. However, much of this software is server side software, and my machine was registered as a workstation. This means the Red Hat Content network won’t show me the server yum repositories. Here is how I converted my machine to be a server.
Running software collections maven from a script
If I want to run software collections code without enabling bash and running interactively, I have to pass the whole command on the command line like this:
scl enable rh-maven35 "mvn package" |
I’ll need to use this form to run from Ansible.
Maven With Software Collections
I’ve been interested in the intersection of Ansible and Java development. To test this out, I want to build a “Hello World” maven App and use Ansible to drive the process to build, test, and deploy it. I’m going to use the Software Collections way of installing and running Maven to build a simple Tomcat Web Application as the basis.
Creating a Job in Ansible Tower via the REST API
Now that we can use the REST API to list inventory, it is not a big stretch to decide we want to kick off Jobs, too. Here it is in a nutshell, and some related operations for working with jobs and templates.
Continue reading
Using an Ansible Tower Inventory from Command Line Ansible
In an earlier post, I wrote about using the OpenStack Ansible inventory helper when calling and Ansible command line tools. However, When developing an playbook, often there is more information pulled from the inventory than just the set of hosts. Often, the inventory also collects variables that are used in common across multiple playbooks. For this reason, and many more, I want to be able to call an Ansible playbook or Ad-Hoc command from the command line, but use the inventory as defined by an Ansible Tower instance. It turns out this is fairly simple to do, using the REST API.
Using the OpenStack inventory helper for Ansible
While Tower makes it easy to manage custom inventory, I still want to develop using the command line. Thus, I want to generate a comparable smart inventory for my Ansible playbook as I get from tower.
Continue reading
Optimizing R: Replace data.frame with parallel vectors
“First make it work, then make it faster” — Brian Kerningham
However, if the program takes too long to run, it might not be possible to make it correct. Iterative development breaks down when each iteration takes several hours. Some R code I was working with was supposed to run for a 1000 iterations, but with each iteration taking 75 seconds to run, we couldn’t take the time to let it run to completion. The problem was the continued appending of rows to a data.frame object. Referred to as the Second Circle here. That in turn points to this larger article about problems R programmers find themselves facing. . How does one extricate oneself? Here were my steps.
Continue reading
Dealing with Time Wasters
Reading draws me in. While this has done me much good in my life, it also means that I can easily get sucked into reading a news site, and waste too much time. It took me a long time to figure out how to effectively block sites that I want to browse occasionally.
Testing if a patch has test coverage
When a user requests a code review, the review is responsible for making sure that the code is tested. While the quality of the tests is a subjective matter, their presences is not; either they are there or they are not there. If they are not there, it is on the developer to explain why or why not.
Not every line of code is testable. Not every test is intelligent. But, at a minimum, a test should ensure that the code in a patch is run at least once, without an unexpected exception.