Configure TOTP key for the web site
[chef.git] / cookbooks / web / definitions / rails_port.rb
index 06a68504b2847b9ec0b38f7e41bc1b6fa44dae0d..bbc3d60d92073235a967d078ef0495ff6d2ee6e5 100644 (file)
@@ -204,6 +204,10 @@ define :rails_port, :action => [:create, :enable] do
       line.gsub!(/^( *)#thunderforest_key:.*$/, "\\1thunderforest_key: \"#{params[:thunderforest_key]}\"")
     end
 
+    if params[:totp_key]
+      line.gsub!(/^( *)#totp_key:.*$/, "\\1totp_key: \"#{params[:totp_key]}\"")
+    end
+
     line.gsub!(/^( *)require_terms_seen:.*$/, "\\1require_terms_seen: true")
     line.gsub!(/^( *)require_terms_agreed:.*$/, "\\1require_terms_agreed: true")