diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-07-11 01:42:07 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-07-11 01:42:07 +0200 |
commit | c188d4ac1713506c3028b4501730713cfda0ed36 (patch) | |
tree | e056a15d599981f963f20365848d4032aa792191 /roles/installer/debian/fetch/filter_plugins | |
parent | preseed/partman: nicer error text for not-enough-space (diff) | |
parent | openbsd installer: improve image verification (diff) |
Merge branch 'topic/debian-installer-verification'
Diffstat (limited to 'roles/installer/debian/fetch/filter_plugins')
-rw-r--r-- | roles/installer/debian/fetch/filter_plugins/main.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/installer/debian/fetch/filter_plugins/main.py b/roles/installer/debian/fetch/filter_plugins/main.py new file mode 100644 index 00000000..298e7efd --- /dev/null +++ b/roles/installer/debian/fetch/filter_plugins/main.py @@ -0,0 +1,27 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible import errors + + +def di_images_path(data): + try: + if data[0] != 'ubuntu': + return 'images' + + if data[1] in ['xenial', 'bionic']: + return 'images' + + return 'legacy-images' + except Exception as e: + raise errors.AnsibleFilterError("mountpoint_exists(): %s" % str(e)) + + +class FilterModule(object): + + filter_map = { + 'di_images_path': di_images_path, + } + + def filters(self): + return self.filter_map |