I am having a problem. I am trying to get a node IP that's running postgresql and is the replication master. So I can implant the IP to repmgr cookbook so it will automatically set it in to SSH config file. I need it because I am not running SSH on port 22 so I need to automatize the process.
This is the configure.rb file:
template File.join(node[:repmgr][:pg_home], '.ssh/config') do
source 'ssh_config.erb'
mode 0644
owner node[:repmgr][:system_user]
group node[:repmgr][:system_user]
variables( :hosts => Array(master_node[:ipaddress]) )
end
directory File.dirname(node[:repmgr][:config_file_path])
template node[:repmgr][:config_file_path] do
source 'repmgr.conf.erb'
mode 0644
end
Master node IP address is taken from attributes (default.rb):
default[:repmgr][:addressing][:master] = nil
I need to change the nil to something else so I can get the IP of the master server so slave aka. standby server can add it's IP to SSH config so it will replicate over my SSH port not the default 22 port.
I hope someone can help be because I am a really new to Ruby and I only know the basics of it.
Thank you. I hope you understand my question.