postgresql_lwrp icon indicating copy to clipboard operation
postgresql_lwrp copied to clipboard

Custom resource

Open masikmos opened this issue 5 years ago • 2 comments

i use zabbix_lwrp him depends postgresql cookbook but i want use postgresql-lwrp BUT! When i use postgresql_user or postgresql_database Custom resource chef use it from postgresql and i see error

[2019-09-10T17:58:48+03:00] ERROR: undefined method in_version' for Custom resource postgresql_user from cookbook postgresql

What i need to do for use Custom resource from postgresql-lwrp in my recipe ??? Help...

masikmos avatar Sep 10 '19 15:09 masikmos

@masikmos Hello!

Thank you for your question and for pointing out to the problem. I'm investigating the situation but I do not have an elegant solution for you right now.

zabbix_lwrp uses postgresql cookbook at least because it supports more platforms so it is unwise to open an issue or PR to migrate to postgresql_lwrp.

I see two ways to address your situation:

  1. fork zabbix_lwrp and remove postgresql.rb recipe with depends "postgresql"
  2. try this: https://stackoverflow.com/questions/51271247/when-two-different-resources-from-two-cookbooks-have-the-same-name-how-can-i-sp

dragonsmith avatar Sep 11 '19 15:09 dragonsmith

nope... link dont work...

i do that

Chef.resource_priority_map.priority(:postgresql_user, [postgresql_lwrp::user]) Chef.resource_priority_map.priority(:postgresql_database, [postgresql_lwrp::database])

and got

[2019-09-12T00:29:53+03:00] ERROR: undefined local variable or method postgresql_lwrp' for cookbook: default, recipe: postgresql11_dbuser :Chef::Recipe

any words after ... [postgresql_lwrp:: do nothing, all time undefined local variable or method `postgresql_lwrp'...

fix 1 should be worked, but i want resource priority )))

Any more ideas? ) Maybe i do something wrong?

masikmos avatar Sep 11 '19 21:09 masikmos