3 \me @ s U d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z mZmZm Z ddlmZ ddlmZ ejeZd gZd dded eedgedgdZe e eZ dZeeeeddddZdd ZdS )z;Autoinstall: Support ubuntu live-server autoinstall syntax. N)dedent)Cloud)Config) MetaSchema SchemaProblemSchemaValidationErrorget_meta_doc)PER_ONCE)subpZubuntuZcc_ubuntu_autoinstallzUbuntu Autoinstallz)Support Ubuntu live-server install syntaxa& Ubuntu's autoinstall YAML supports single-system automated installs in either the live-server install, via the ``subiquity`` snap, or the next generation desktop installer, via `ubuntu-desktop-install` snap. When "autoinstall" directives are provided in either ``#cloud-config`` user-data or ``/etc/cloud/cloud.cfg.d`` validate minimal autoinstall schema adherance and emit a warning if the live-installer is not present. The live-installer will use autoinstall directives to seed answers to configuration prompts during system install to allow for a "touchless" or non-interactive Ubuntu system install. For more details on Ubuntu's autoinstaller: https://ubuntu.com/server/docs/install/autoinstall a # Tell the live-server installer to provide dhcp6 network config # and LVM on a disk matching the serial number prefix CT autoinstall: version: 1 network: version: 2 ethernets: enp0s31f6: dhcp6: yes storage: layout: name: lvm match: serial: CT* autoinstall)idnametitledescriptiondistrosZexamplesZ frequencyZactivate_by_schema_keys subiquityubuntu-desktop-installer)r cfgcloudargsreturnc C s| d|krt jd| d S tddg\}}d }xtD ]}tj||r2|}q2W |sdt jddjt d S t| t jd| d S )Nr z?Skipping module named %s, no 'autoinstall' key in configurationZsnaplistzaSkipping autoinstall module. Expected one of the Ubuntu installer snap packages to be present: %sz, z8Valid autoinstall schema. Config will be processed by %s) LOGdebugr LIVE_INSTALLER_SNAPSresearchZwarningjoinvalidate_config_schema)r r r r Z snap_list_Zinstaller_presentZ snap_name r +/usr/lib/python3.6/cc_ubuntu_autoinstall.pyhandleM s&