Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9298409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:19:04+00:00 2026-06-18T22:19:04+00:00

I am having a problem. I am trying to get a node IP that’s

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:19:05+00:00Added an answer on June 18, 2026 at 10:19 pm

    If you are using chef-server, then you can find other provisioned nodes through search in recipe. You can search for nodes by different properties: such as role, recipe, environment, name and so on. I hope your replication master node has some attribute that makes it unique, for example postgres recipe or replication-master role in run_list.

    nodes = search( :node, 'recipes:postgres' )
    

    or

    nodes = search( :node, 'role:replication-master' )
    

    Search returns an array of nodes that have the corresponding attributes.
    And then:

    node.default[:repmgr][:addressing][:master] = nodes.first[:ipaddress]
    

    The code should be written in recipe file, not in attributes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get started with PEAR's HTML_QuickForm but I'm having a problem.
I am having a bit of a problem, I am trying to get a
I'm having a problem trying to create a Javascript function that checks all the
I'm having a problem with encoding from a wordpress feed that I just can't
I've been having a problem trying to get OpenGL 3.2 to work and after
I'm having an annoying problem trying to get an html page with a google
Problem: I am having trouble generating an xpath expression that selects a node in
I've noticed that in trying to get seemingly simple node packages to install with
I'm having a problem trying to get working those 2 plugins together: Localisation (for
I am having a problem trying to get the user details after signing in.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.