Bird-1.6: failed configure check and exit status 0
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
Sam, On 22.01.2018 11:39, fatal wrote:
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.
Use bird -p for that: # bird -p -c /etc/bird/bird.conf; echo $? 0 # bird -p -c /etc/profile; echo $? bird: /etc/profile, line 4: syntax error 1 Best, Piotr -- Piotr 'GhosT' Wydrych ........ Senior Lead Sw. Eng., SDN ........ Akamai ........................................................................ A: Because it messes up the order in which people normally read text. .. Q: Why is top-posting such a bad thing? ................................
Dear Piotr, perfect! T hanks for such a quick reply! Regards Sam On 22.01.2018 11:45, Piotr Wydrych wrote:
Sam,
On 22.01.2018 11:39, fatal wrote:
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.
Use bird -p for that:
# bird -p -c /etc/bird/bird.conf; echo $? 0 # bird -p -c /etc/profile; echo $? bird: /etc/profile, line 4: syntax error 1
Best, Piotr
participants (2)
-
fatal -
Piotr Wydrych