About | FAQ | Help
Ask Your Question
0

Concat problem with Keepalived recipe

asked 2018-05-18 08:42:31 -0500

moscardo gravatar image

updated 2018-05-19 05:05:27 -0500

Hi, Keepalived recipe is not being executed but this Warning is displayed, which I don't really understand:

Warning: /Stage[main]/Eml::Loadbalancer_keepalived/Keepalived::Vrrp::Script[chk_haproxy]/Concat::Fragment[keepalived.conf_vrrp_script_chk_haproxy]/Concat_fragment[keepalived.conf_vrrp_script_chk_haproxy]: Target Concat_file with path of /keepalived.conf not found in the catalog Warning: /Stage[main]/Eml::Loadbalancer_keepalived/Keepalived::Vrrp::Instance[VI_1]/Concat::Fragment[keepalived.conf_vrrp_instance_VI_1]/Concat_fragment[keepalived.conf_vrrp_instance_VI_1]: Target Concat_file with path of /keepalived.conf not found in the catalog Warning: /Stage[main]/Eml::Loadbalancer_keepalived/Keepalived::Vrrp::Instance[VI_2]/Concat::Fragment[keepalived.conf_vrrp_instance_VI_2]/Concat_fragment[keepalived.conf_vrrp_instance_VI_2]: Target Concat_file with path of /keepalived.conf not found in the catalog

I may have messed up with the concat version...but I've tried to roll back to the version I had before.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-05-18 17:17:34 -0500

binford2k gravatar image

You'll have to post your actual code generating this error for anyone to be able to actually diagnose it.

That said, I can guess that you're trying to use concat fragments without ever declaring a concat resource. Here's an example of declaring both.

# This resource declares & manages the file
concat { '/tmp/file':
  ensure => present,
}

# and these fragments define the content of ^^ that file
concat::fragment { 'tmpfile':
  target  => '/tmp/file',  # this target points to the path of the concat resource above
  content => 'This will come first',
  order   => '01'
}

concat::fragment { 'tmpfile':
  target  => '/tmp/file',
  content => 'This will come second',
  order   => '02'
}
edit flag offensive delete link more
0

answered 2018-05-19 05:02:49 -0500

moscardo gravatar image

updated 2018-05-22 04:39:13 -0500

Hi, thanks for your answer, the thing is that I don't directly use Concat in my code

# Configuring Keepalived haproxy01
class eml::loadbalancer_keepalived {
  case $::hostname {
    'haproxy01': {
      include keepalived
      keepalived::vrrp::script { 'chk_haproxy':
        script => 'killall -0 haproxy', # check the haproxy process
        interval => '2', # every 2 seconds
        weight => '2', # add 2 points if OK
      }
      # Web  haproxy01
      keepalived::vrrp::instance { 'VI_1':
        interface         => 'ens192',
        state             => 'MASTER', # interface to monitor
        virtual_router_id => '51', 
        priority          => '101', # 101 on haproxy01, 100 on haproxy02
        virtual_ipaddress => ['10.11.6.29'],
        track_script      => 'chk_haproxy',
      }
      # imap, pop3, smtp haproxy01
      keepalived::vrrp::instance { 'VI_2':
        interface         => 'ens192',
        state             => 'MASTER', # interface to monitor
        virtual_router_id => '52',
        priority          => '101', # 101 on haproxy01, 100 on haproxy02
        virtual_ipaddress => ['10.11.6.39'],
        track_script      => 'chk_haproxy',
      }
    }
  # Configuring Keepalived haproxy02
    default: {
      include keepalived
      keepalived::vrrp::script { 'chk_haproxy':
        script => 'killall -0 haproxy', # check the haproxy process
        interval => '2', # every 2 seconds
        weight => '2', # add 2 points if OK
      }
      # Web  haproxy02.
      keepalived::vrrp::instance { 'VI_1':
        interface         => 'ens192',
        state             => 'BACKUP', # interface to monitor
        virtual_router_id => '51', 
        priority          => '100', # 101 on haproxy01, 100 on haproxy02
        virtual_ipaddress => ['10.11.6.29'],
        track_script      => 'chk_haproxy',
      }
      # imap, pop3, smtp haproxy01.
      keepalived::vrrp::instance { 'VI_2':
        interface         => 'ens192',
        state             => 'BACKUP', # interface to monitor
        virtual_router_id => '52',
        priority          => '100', # 101 on haproxy01, 100 on haproxy02
        virtual_ipaddress => ['10.11.6.39'],
        track_script      => 'chk_haproxy',
      }
    }
  }
}

I have tried to hardcode the path where keepalived.conf should be modified but I still get the warning:

Warning: /Stage[main]/Embl::Loadbalancer_keepalived/Keepalived::Vrrp::Instance[VI_2]/Concat::Fragment[keepalived.conf_vrrp_instance_VI_2]/Concat_fragment[keepalived.conf_vrrp_instance_VI_2]: Target Concat_file with path of /etc/keepalived/keepalived.conf not found in the catalog
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-05-18 08:42:31 -0500

Seen: 49 times

Last updated: May 22