Last active
February 8, 2018 12:05
-
-
Save dni/fdadabe288b7c98567e1ad31edde7de5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search("aws_opsworks_app").each do |app| | |
if app["deploy"] | |
ssl_conf = "/etc/letsencrypt/live/#{domain}/fullchain.pem" | |
## works herre | |
execute "request certificat #{domain}" do | |
command "certbot --text --non-interactive --email office@dnilabs.com --agree-tos --agree-dev-preview "\ | |
"--authenticator webroot --installer apache -d #{domain} --webroot-path #{document_root}" | |
not_if { File.exist?(ssl_conf) } | |
ignore_failure true | |
end | |
# ruby_block "check file exists" do | |
# block do | |
# enablessl = File.exist?(ssl_conf) | |
# end | |
# end | |
# doesnt work here | |
template "/etc/apache2/sites-enabled/#{name}.conf" do | |
source "vhost.conf.erb" | |
mode "0644" | |
variables ( | |
:name => name, | |
:domain => domain, | |
:domains => domains, | |
:ssl => lazy { File.exist?(ssl_conf) } | |
) | |
end | |
execute "reload apache" do | |
command "service apache2 reload" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment