mirror of
https://github.com/krislamo/puppet-acme_vault
synced 2024-12-16 04:40:35 +00:00
add email conf for acme s/requestor/request
This commit is contained in:
parent
38baf28f02
commit
65d765301e
1
Rakefile
1
Rakefile
@ -1,2 +1,3 @@
|
|||||||
require 'puppetlabs_spec_helper/rake_tasks'
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||||||
require 'puppet-syntax/tasks/puppet-syntax'
|
require 'puppet-syntax/tasks/puppet-syntax'
|
||||||
|
PuppetLint.configurationsend('disable_arror_on_right_operand_line')
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Common configuration for acme_vault
|
# Common configuration for acme_vault
|
||||||
#
|
#
|
||||||
# This class needs to be included before acme_vault::requestor or
|
# This class needs to be included before acme_vault::request or
|
||||||
# acme_vault::deploy and contains configurations common to both. The user,
|
# acme_vault::deploy and contains configurations common to both. The user,
|
||||||
# vault, vault vars, and cron mailto are needed for both requestor and deploy
|
# vault, vault vars, and cron mailto are needed for both request and deploy
|
||||||
|
|
||||||
class acme_vault::common (
|
class acme_vault::common (
|
||||||
$user = $::acme_vault::params::user,
|
$user = $::acme_vault::params::user,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# params for both common, requestor, and deploy
|
# params for both common, request, and deploy
|
||||||
class acme_vault::params {
|
class acme_vault::params {
|
||||||
# settings for acme user
|
# settings for acme user
|
||||||
$user = 'acme'
|
$user = 'acme'
|
||||||
@ -9,7 +9,6 @@ class acme_vault::params {
|
|||||||
$staging = true
|
$staging = true
|
||||||
$staging_url = 'https://acme-staging-v02.api.letsencrypt.org/directory'
|
$staging_url = 'https://acme-staging-v02.api.letsencrypt.org/directory'
|
||||||
$prod_url = 'https://acme-v02.api.letsencrypt.org/directory'
|
$prod_url = 'https://acme-v02.api.letsencrypt.org/directory'
|
||||||
#TODO configurue email
|
|
||||||
$contact_email = ''
|
$contact_email = ''
|
||||||
|
|
||||||
$acme_revision = 'HEAD'
|
$acme_revision = 'HEAD'
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
# coordination to eventually reach the desired end state. Since certificate
|
# coordination to eventually reach the desired end state. Since certificate
|
||||||
# renewal has a large time window, this is acceptable.
|
# renewal has a large time window, this is acceptable.
|
||||||
|
|
||||||
class acme_vault::requestor (
|
class acme_vault::request (
|
||||||
$user = $::acme_vault::common::user,
|
$user = $::acme_vault::common::user,
|
||||||
$group = $::acme_vault::common::group,
|
$group = $::acme_vault::common::group,
|
||||||
$home_dir = $::acme_vault::common::home_dir,
|
$home_dir = $::acme_vault::common::home_dir,
|
||||||
@ -32,7 +32,7 @@ class acme_vault::requestor (
|
|||||||
|
|
||||||
include acme_vault::common
|
include acme_vault::common
|
||||||
|
|
||||||
$requestor_bashrc_template = @(END)
|
$request_bashrc_template = @(END)
|
||||||
export TLDEXTRACT_CACHE=$HOME/.tld_set
|
export TLDEXTRACT_CACHE=$HOME/.tld_set
|
||||||
export PROVIDER=<%= @lexicon_provider %>
|
export PROVIDER=<%= @lexicon_provider %>
|
||||||
export LEXICON_<%= @lexicon_provider.upcase %>_USERNAME=<%= @lexicon_username %>
|
export LEXICON_<%= @lexicon_provider.upcase %>_USERNAME=<%= @lexicon_username %>
|
||||||
@ -46,9 +46,9 @@ END
|
|||||||
})
|
})
|
||||||
|
|
||||||
# variables in bashrc
|
# variables in bashrc
|
||||||
concat::fragment { 'requestor_bashrc':
|
concat::fragment { 'request_bashrc':
|
||||||
target => "${home_dir}/.bashrc",
|
target => "${home_dir}/.bashrc",
|
||||||
content => inline_template($requestor_bashrc_template),
|
content => inline_template($request_bashrc_template),
|
||||||
order => '02',
|
order => '02',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,6 +61,24 @@ END
|
|||||||
revision => $acme_revision,
|
revision => $acme_revision,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { "${home_dir}/.acme.sh":
|
||||||
|
ensure => directory,
|
||||||
|
owner => $user,
|
||||||
|
group => $group,
|
||||||
|
mode => '0700',
|
||||||
|
} ->
|
||||||
|
file { "${home_dir}/.acme.sh/account.conf":
|
||||||
|
ensure => present,
|
||||||
|
owner => $user,
|
||||||
|
group => $group,
|
||||||
|
mode => '0600',
|
||||||
|
} ->
|
||||||
|
file_line { ' add email to acme conf':
|
||||||
|
path => "${home_dir}/.acme.sh/account.conf",
|
||||||
|
line => "ACCOUNT_EMAIL=${contact_email}",
|
||||||
|
match => '^ACCOUNT_EMAIL=.*$',
|
||||||
|
}
|
||||||
|
|
||||||
# create issue scripts
|
# create issue scripts
|
||||||
$domains.each |$domain, $d_list| {
|
$domains.each |$domain, $d_list| {
|
||||||
file {"/${home_dir}/${domain}.sh":
|
file {"/${home_dir}/${domain}.sh":
|
Loading…
Reference in New Issue
Block a user