Skip to content

Commit

Permalink
Merge pull request #322 from martijndegouw/feature/certbotversion
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex authored Jun 30, 2023
2 parents 2dcc8a7 + daa8363 commit c125cb8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ letsencrypt::renew_deploy_hook_commands:

## Facts

* [certbot_version](#fact-certbotversion)
* [letsencrypt_directory](#fact-letsencryptdirectory)

### Fact: certbot_version

A fact that contains the current version of certbot installed on your operating system/distribution.

### Fact: letsencrypt_directory

Facts about your live certificates are available through facter. You can query the list of live certificates from puppet using `$::letsencrypt_directory` in your puppet code, hiera data or from the command line.

```
Expand Down
10 changes: 10 additions & 0 deletions lib/facter/certbot_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

Facter.add(:certbot_version) do
confine { Facter::Core::Execution.which('certbot') }

setcode do
output = Facter::Core::Execution.execute('certbot --version 2>/dev/null')
output[%r{^certbot (.*)$}, 1] if output
end
end

0 comments on commit c125cb8

Please sign in to comment.