Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another solution to have differend zoo_id #138

Open
rmalenko opened this issue Nov 4, 2019 · 1 comment
Open

Another solution to have differend zoo_id #138

rmalenko opened this issue Nov 4, 2019 · 1 comment

Comments

@rmalenko
Copy link

rmalenko commented Nov 4, 2019

In manifest add something like this

case $trusted['certname'] {
    'dsp-zoo-01.domain.com': { $privateip = ['192.168.0.7/24']; $netiface ='eth1'; $zooid ='01' }
    'dsp-zoo-02.domain.com': { $privateip = ['192.168.0.7/24']; $netiface ='eth1'; $zooid ='02' }
    'dsp-zoo-03.domain.com': { $privateip = ['192.168.0.7/24']; $netiface ='eth1'; $zooid ='03' }
    default: { $privateip = '' }
  }

then

class { 'zookeeper':
  ...
  id                      => $zooid,
  ...
}
@ochykysh
Copy link

ochykysh commented Feb 6, 2020

Or just create a custom fact based on hostname, so say somehost001 has id 1.

Facter.add(:hostid) do
  setcode do
    Facter.value(:hostname).gsub(/[^0-9]/, '').sub!(/^0+/, "")
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants