X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/9bca5f05185dde08efcf2d5f1a2bf66c8cdc9f00..5dbcbc9fc104320252388249ad1fbb9984bb5339:/cookbooks/postgresql/providers/user.rb diff --git a/cookbooks/postgresql/providers/user.rb b/cookbooks/postgresql/providers/user.rb index 4f21b4d29..5df0f3847 100644 --- a/cookbooks/postgresql/providers/user.rb +++ b/cookbooks/postgresql/providers/user.rb @@ -17,6 +17,10 @@ # limitations under the License. # +require "shellwords" + +use_inline_resources + def load_current_resource @pg = Chef::PostgreSQL.new(new_resource.cluster) @@ -33,7 +37,7 @@ def load_current_resource end action :create do - password = new_resource.password ? "ENCRYPTED PASSWORD '#{new_resource.password}'" : "" + password = new_resource.password ? "ENCRYPTED PASSWORD '#{new_resource.password.shellescape}'" : "" superuser = new_resource.superuser ? "SUPERUSER" : "NOSUPERUSER" createdb = new_resource.createdb ? "CREATEDB" : "NOCREATEDB" createrole = new_resource.createrole ? "CREATEROLE" : "NOCREATEROLE"