In my day job, I sometimes need to use a self-signed certificate when building a box. As I love using Ansible, I wanted to make the self-signed certificate piece something that was part of my Ansible workflow.
Here follows a bit of basic code that you could use to work through how the process of creating a self-signed certificate would work. I would strongly recommend using something more production-ready (e.g. LetsEncrypt) when you’re looking to move from “development” to “production” :)
I’m using this:
cmmand: “openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout http://www.example.com.pem -out http://www.example.com.pem”
:)