puppet-keepalived icon indicating copy to clipboard operation
puppet-keepalived copied to clipboard

New track_file syntax generates invalid config

Open normelton opened this issue 2 years ago • 2 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.6.1
  • Ruby: 2.7.0
  • Distribution: Ubuntu 20.04
  • Module version: 3.5.0
  • Keepalive version: 2.0.19

How to reproduce (e.g Puppet code you use)

  keepalived::vrrp::track_file { 'mysql-active':
    file_name => '/var/run/mysql-active',
    weight    => 0,
    init_file => '1'
  }

What are you seeing

Here's the resulting config in keepalived.conf. I think that track_file is not a valid config stanza.

track_file mysql-active {
  file     "/var/run/mysql-active"
  weight      0
  init_file 1
}

What behaviour did you expect instead

Should be vrrp_track_file instead:

vrrp_track_file mysql-active {
  file     "/var/run/mysql-active"
  weight      0
  init_file 1
}

Any additional information you'd like to impart

I can 100% submit a PR for this. Just want to make sure I'm not missing something obvious.

normelton avatar Dec 16 '22 04:12 normelton

Okay, so the syntax I expected (vrrp_track_file) is appropriate for keepalived < 2.1.0. Later versions changed to "track_file". I submitted a PR that generates the correct syntax based on the keepalived_version fact.

normelton avatar Jan 09 '23 01:01 normelton

Compare my Comment.

cocker-cc avatar Mar 14 '24 19:03 cocker-cc