/img/me.png

Just some guy on the internet.

Force Local Users and Groups with Ansible

I’m in the process of migrating a few Puppet modules over to Ansible, and in the process I’ve run into an unusual situation while creating users and groups. Here is some background. I have an application that will refuse to complete its installation unless it can see certain users and groups in the local passwd and group files. It just so happens that these same users and groups are also contained in LDAP.

Convert a pem file into a rsa private key

When you build a server in AWS one of the last steps is to either acknowledge that you have access to an existing pem file, or to create a new one to use when authenticating to your ec2 server. If you want to convert that file into an rsa key that you can use in an ssh config file, you can use this handy dandy openssl command string. openssl rsa -in somefile.

How to get started using Ansible

Install Ansible On most Linux distributions Ansible can be installed directly through your distribution’s package manager. For those using macOS or a distribution that doesn’t package Ansible, you can install it via python pip. The Ansible docs have a really good walkthrough for installation that can be found here:http://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html I won’t repeat those instructions except to say that you will want to make sure that the computer you install Ansible on should have Python 2.

Three reasons to start using Ansible

A few months ago I attended a one day Ansible workshop in Columbus Ohio with a colleague. The workshop was sponsored by Red Hat and contained several labs, which is well worth your time if you have the opportunity. I wasn’t sure what to expect, generally you don’t walk away with much working knowledge from these short events, but I had some experience with Puppet (most of it frustrating) and I was curious to see what Ansible could do for my organization.

The caret is mightier than the up arrow

I learned a fun bash trick a while ago that I thought I would share. In a bash shell you can use the caret ^ symbol to find and replace a sequence of characters in your previous command. For instance if you type: sudo systemctl restart httpd and then want to look at the status of the httpd service all you need to do is: ^restart^status Bash will look at the last command in your history and replace the first occurrence of “restart” with “status” and run the new command.

LXD/LXC

I’ve been spending quite a bit of time learning about LXD/LXC containers on Ubuntu. There is a lot of really good information available about how to get started with these containers so I’m not going try to reproduce that content here, however, I will provide links at the bottom that I think are relevant to learn more about LXD and LXC. Below I outline what it is that I like about LXC these reasons are also the driving factors behind my decision to use LXC for web hosting as opposed to other container technologies.