From 430871e37ab3c81d1ff0dc2cf615d7d49fe23a25 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Sun, 22 Nov 2020 20:53:53 +0000 Subject: [PATCH] feat: add mkcert install and config See: https://github.com/FiloSottile/mkcert --- manifests/workstation.pp | 1 + site-modules/core/manifests/mkcert.pp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 site-modules/core/manifests/mkcert.pp diff --git a/manifests/workstation.pp b/manifests/workstation.pp index 039c123..5416735 100644 --- a/manifests/workstation.pp +++ b/manifests/workstation.pp @@ -25,6 +25,7 @@ node default { include core::vscode include core::emacs include core::terminal + include core::mkcert # # Add the private puppet module for all the proprietary bits only if the diff --git a/site-modules/core/manifests/mkcert.pp b/site-modules/core/manifests/mkcert.pp new file mode 100644 index 0000000..cee8047 --- /dev/null +++ b/site-modules/core/manifests/mkcert.pp @@ -0,0 +1,21 @@ +class core::mkcert { + archive { "${user_home}/.local/bin/mkcert": + ensure => present, + source => 'https://github.com/FiloSottile/mkcert/releases/download/v1.4.2/mkcert-v1.4.2-linux-amd64', + checksum => 'e116543bfabb4d88010dda8a551a5d01abbdf9b4f2c949c044b862365038f632', + checksum_type => 'sha256', + } + + exec { 'mkcert permission': + command => "chmod +x ${user_home}/.local/bin/mkcert", + path => '/bin:/usr/bin', + subscribe => Archive["${user_home}/.local/bin/mkcert"], + } + + exec { 'install root ca': + command => "${user_home}/.local/bin/mkcert -install", + environment => [ "HOME=${user_home}" ], + path => '/bin:/usr/bin', + subscribe => Archive["${user_home}/.local/bin/mkcert"], + } +}