Skip to content

Commit c125cb8

Browse files
authored
Merge pull request #322 from martijndegouw/feature/certbotversion
2 parents 2dcc8a7 + daa8363 commit c125cb8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,15 @@ letsencrypt::renew_deploy_hook_commands:
255255

256256
## Facts
257257

258+
* [certbot_version](#fact-certbotversion)
259+
* [letsencrypt_directory](#fact-letsencryptdirectory)
260+
261+
### Fact: certbot_version
262+
263+
A fact that contains the current version of certbot installed on your operating system/distribution.
264+
265+
### Fact: letsencrypt_directory
266+
258267
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.
259268

260269
```

lib/facter/certbot_version.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
Facter.add(:certbot_version) do
4+
confine { Facter::Core::Execution.which('certbot') }
5+
6+
setcode do
7+
output = Facter::Core::Execution.execute('certbot --version 2>/dev/null')
8+
output[%r{^certbot (.*)$}, 1] if output
9+
end
10+
end

0 commit comments

Comments
 (0)