diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-04 18:40:37 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-14 11:35:08 +0800 |
commit | 90a558152c16e547b079091c3a36d1da8ddebdfd (patch) | |
tree | 9f1fcd078a8d88c34e54a085da34330dc26a38a5 /filter_plugins | |
parent | 161c8d21059ca3e709f03de9205e24ef0820c3d0 (diff) | |
download | ansible-dfly-vps-90a558152c16e547b079091c3a36d1da8ddebdfd.tar.bz2 |
filter/dns: next_serial checks drill and dig
Diffstat (limited to 'filter_plugins')
-rw-r--r-- | filter_plugins/dns.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/filter_plugins/dns.py b/filter_plugins/dns.py index 9fdca29..5b26b29 100644 --- a/filter_plugins/dns.py +++ b/filter_plugins/dns.py @@ -36,8 +36,13 @@ def run_query(cmd, rtype, fqdn, ns=None): def next_serial(fqdn): - cmd = "drill" - cmd_path = which(cmd) + """ + Generate the next serial number for the DNS SOA record. + """ + for cmd in ["drill", "dig"]: + cmd_path = which(cmd) + if cmd_path: + break if cmd_path is None: raise Exception("Cannot find %s" % cmd) |