[katello-devel] Fwd: [katello-commits] [katello/password_reset] installer - minor changes to support user email and host

Brad Buckingham bbuckingham at redhat.com
Tue Nov 8 15:21:14 UTC 2011


Hi Cliff,

Thanks for the feedback.

We can change the name of the property to 'mail_host' or something 
different, if it'll make it clearer; however,  I intentionally made it 
generic.  Although, the first use case for the property is for passing 
the location of the Katello server within email, it could potentially be 
used in other ways in the future.  To support those cases, I didn't 
really want it tied directly to mail, in fear that the next developer 
might add another property.

cheers,
Brad

On 11/08/2011 08:38 AM, Cliff Perry wrote:
> Heya Brad,
> looks good!
>   One feedback. The usage of 'host' is very generic. I would suggest to
> use 'mail_host' to help make it clear what the variable is being used
> for (aside from reading comments) :)
>
> Cliff
>
>
> -------- Original Message --------
> Subject: [katello-commits] [katello/password_reset] installer - minor
> changes to support user email and host
> Date: Mon,  7 Nov 2011 23:05:32 +0000 (UTC)
> From: Brad Buckingham<bbuckingham at fedoraproject.org>
> Reply-To: katello-commits at lists.fedorahosted.org
> To: katello-commits at lists.fedorahosted.org
>
> commit 5b9f898631f6a6e196c1dacef92908178f05616d
> Author: Brad Buckingham<bbuckingham at redhat.com>
> Date:   Mon Nov 7 14:43:59 2011 -0500
>
>      installer - minor changes to support user email and host
>
>      As part of the feature to support password reset, we had to add
>      a couple of things that need to be accounted for in the installer:
>
>      1. user - email address added as a required field
>      2. host (fqdn) - added to katello.yml so that we could specify the
>         fqdn that the server is running as... initially, this fqdn
>         is necessary for sending in email to users, so that they can
>         click link to reset their password.
>
>   puppet/default-answer-file                         |    6 ++++++
>   puppet/modules/katello/manifests/config.pp         |    8 ++++++++
>   puppet/modules/katello/manifests/params.pp         |    2 ++
>   .../katello/templates/etc/katello/katello.yml.erb  |   15 +++++++++++++++
>   4 files changed, 31 insertions(+), 0 deletions(-)
> ---
> diff --git a/puppet/default-answer-file b/puppet/default-answer-file
> index b963992..71c4998 100644
> --- a/puppet/default-answer-file
> +++ b/puppet/default-answer-file
> @@ -8,9 +8,15 @@ user_name = admin
>   # Katello user's password (default: admin)
>   user_pass = admin
>
> +# Katello user's email (default: admin at localhost)
> +user_email = admin at localhost
> +
>   # Katello initial Organization (default: ACME_Corporation)
>   org_name = ACME_Corporation
>
> +# Katello server host or fully qualified domain (default: 127.0.0.1)
> +host = 127.0.0.1
> +
>   # Katello database name.
>   # PostgreSQL database name used to store the Katello database
>   # objects.
> diff --git a/puppet/modules/katello/manifests/config.pp
> b/puppet/modules/katello/manifests/config.pp
> index bba10e0..cdf640b 100644
> --- a/puppet/modules/katello/manifests/config.pp
> +++ b/puppet/modules/katello/manifests/config.pp
> @@ -73,6 +73,14 @@ class katello::config {
>         require =>  [ Class["candlepin::service"], Class["pulp::service"] ],
>     }
>
> +  common::simple_replace { "primary_user_email":
> +      file =>  "/usr/share/katello/db/seeds.rb",
> +      pattern =>  "email =>  'root at localhost'",
> +      replacement =>  "email =>  '$katello::params::user_email'",
> +      before =>  Exec["katello_seed_db"],
> +      require =>  [ Class["candlepin::service"], Class["pulp::service"] ],
> +  }
> +
>     exec {"katello_db_migrate":
>       cwd         =>  $katello::params::katello_dir,
>       user        =>  $katello::params::user,
> diff --git a/puppet/modules/katello/manifests/params.pp
> b/puppet/modules/katello/manifests/params.pp
> index fcd95d0..c398311 100644
> --- a/puppet/modules/katello/manifests/params.pp
> +++ b/puppet/modules/katello/manifests/params.pp
> @@ -2,6 +2,7 @@ class katello::params {
>     # First User and Org settings
>     $user_name = katello_config_value('user_name')
>     $user_pass = katello_config_value('user_pass')
> +  $user_email = katello_config_value('user_email')
>     $org_name  = katello_config_value('org_name')
>
>     # database settings
> @@ -11,6 +12,7 @@ class katello::params {
>     $deployment = katello_config_value('deployment')
>
>     # system settings
> +  $host        = katello_config_value('host')
>     $user        = "katello"
>     $group       = "katello"
>     $config_dir  = "/etc/katello"
> diff --git
> a/puppet/modules/katello/templates/etc/katello/katello.yml.erb
> b/puppet/modules/katello/templates/etc/katello/katello.yml.erb
> index 1fb907a..649ffc4 100644
> --- a/puppet/modules/katello/templates/etc/katello/katello.yml.erb
> +++ b/puppet/modules/katello/templates/etc/katello/katello.yml.erb
> @@ -8,6 +8,16 @@
>   # The following configuration values are the same for production, test
>   # and development environments. Values can be overriden bellow.
>   #
> +# host (default=127.0.0.1): The host (i.e. fully qualified domain name)
> of the
> +#   server.  This host is used by ActionMailer when generating urls sent in
> +#   emails from the server.  For example, the host would be the fqdn
> portion
> +#   of a URL for resetting a user's password.
> +#
> +# port: Similar to host; however, provides the port component of the URL.
> +#
> +# password_reset_expiration (default=10): Specifies the number of
> +#   minutes that a password reset token will remain valid.
> +#
>   common:
>     ldap:
>       host:<%= scope.lookupvar("katello::params::ldap_server") %>
> @@ -18,6 +28,11 @@ common:
>     use_pulp:<%= scope.lookupvar("katello::params::deployment") ==
> 'katello' %>
>     rest_client_timeout: 30
>
> +  host:<%= scope.lookupvar("katello::params::host") %>
> +  use_ssl: true
> +
> +  password_reset_expiration: 10
> +
>   #setup how often you want
>   #your notifications to be checked
>   #for you to receive the right notifications
> _______________________________________________
> katello-commits mailing list
> katello-commits at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/katello-commits
>
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel




More information about the katello-devel mailing list