Bird-1.6: failed configure check and exit status 0

fatal fatal at mailbox.org
Mon Jan 22 11:39:00 CET 2018


Hello,

I'm using bird 1.6.3 on Debian Stretch and am trying to automate the
installation and configuration with ansible. Therefore the "configure
check" feature of bird comes in handy. Unfortunately the return code is
always "0" whether the config is OK or KO.

$ sudo /usr/sbin/birdc configure check

BIRD 1.6.3 ready.
Reading configuration from /etc/bird/bird.conf
Configuration OK

$ echo $?
0

After invalidating the config file:

$ sudo /usr/sbin/birdc configure check

BIRD 1.6.3 ready.
Reading configuration from /etc/bird/bird.conf
/etc/bird/bird.conf, line 7: syntax error

$ echo $?
0

I can build my playbook around this with grepping for "Configuration OK"
in the output[1], but it would be nice to habe bird return a non zero
value if the config check fails.

Thanks a lot

regards

Sam

[1]
- name: check bird config
  command: /usr/sbin/birdc configure check
  register: bird_result
  changed_when: False
  failed_when: bird_result.stdout.find('Configuration OK') ==-1


More information about the Bird-users mailing list