Deploy Root Certificates to Debian-based Linux systems with Ansible

There are numerous advantages to deploying an internal root CA to an enterprise:

The only major obstacle to internal CAs happens to be a pretty old one - finding a scalable way to deliver the root Certificate Authority to appropriate “trust stores” (they do exactly what it sounds like they do) on all managed systems. Here are a few “hot-spots” that I’ve found over the years, ordered from high-value, low effort to low-value, high effort. They’re all worthwhile, so please consider it an “order of operations” and not an elimination list:

Hopefully it’s pretty clear that automation is about to become your new best friend when it comes to internal CA administration. Let’s outline how we’d want to tackle the Linux aspects of this problem:

Here’s where the beauty of idempotency really starts to shine. With Ansible, it’s possible to just set a schedule for the playbook to execute in a CI tool like Jenkins. CI tools add some neat features here, like only executing on a source control change, which may not apply when using an artifacts store to deploy the root certificate.

In this example, I will be adding the play to my nightly update playbook to illustrate how easy this is:

After completion, this action can be tested by a wide variety of means - my favorite would be cURLing a web service that leverages the root CA:

curl https://nsx.engyak.co/