as stated in the docs you should be able to provide a username when using the format pgsql.
The username should be provided in the format 'username: ted'.
The class Trocla::Formats::Pgsql checks for the exsitence of options['username'] and if so, it uses it to construct the md5.
In fact options['username'] does not contain the actual user given but only the string 'username'.
You can easily verify that by adding a debug output within that class like so:
class Trocla::Formats::Pgsql < Trocla::Formats::Base
require 'digest/md5'
def format(plain_password,options={})
raise "You need pass the username as an option to use this format" unless options['username']
p "Username: " + options['username']
"md5" + Digest::MD5.hexdigest(plain_password + options['username'])
end
end
The result is:
>trocla set hiera/../../hieradb/nodes/postgres/ted pgsql 'username: ted'
Enter your password: xxxxxxxxxx
Repeat password: xxxxxxxxxx
"Username: username"
Because of that the trocla postgres feature cannot be used.
Hi,
as stated in the docs you should be able to provide a username when using the format pgsql. The username should be provided in the format 'username: ted'.
The class Trocla::Formats::Pgsql checks for the exsitence of options['username'] and if so, it uses it to construct the md5.
In fact options['username'] does not contain the actual user given but only the string 'username'.
You can easily verify that by adding a debug output within that class like so:
The result is:
Because of that the trocla postgres feature cannot be used.