The part-handler is compatible with the upstream Cloud-init package and can be integrated into them. With such integration possible to enter VyOS configuration directly into the User-Data field without any additional modifications.
- Place the
vyos_handler.pyfile intocloudinit/handlers/directory of upstream package. - Change the
cloudinit/handlers/__init__.pyfile, adding two more types into theINCLUSION_TYPES_MAP:
'#vyos-config-plain': 'text/plain',
'#vyos-config-notmulti': 'text/x-not-multipart',
- Enable the handler by editing the
cloudinit/stages.pyfile:- add import for the handler:
from cloudinit.handlers.vyos_handler import VyOSConfigPartHandler - add the handler processing in the
_default_handlers()function - insert after theUpstartJobPartHandler(**opts),:VyOSConfigPartHandler(**opts),
- add import for the handler:
The patch for integrating the part-handler into Cloud-init 20.1-5-g67c8e53c-0ubuntu1 can be found in the current directory.