oB]c@s>dZddlZddlmZddlmZmZddlmZddl m Z ddl m Z eZ dgZ i d d 6d d 6d d6edd6e d6edgd6ed6dd6iidd6iidd6idd6d6idd6gd6d6ed6ed6dd6gd6d 6d!6ZeeZd"ZdS(#s:Bootcmd: run arbitrary commands early in the boot process.iN(tdedent(tget_schema_doctvalidate_cloudconfig_schema(t PER_ALWAYS(t temp_utils(tutiltallt cc_bootcmdtidtBootcmdtnames0Run arbitrary commands early in the boot processttitles This module runs arbitrary commands very early in the boot process, only slightly after a boothook would run. This is very similar to a boothook, but more user friendly. The environment variable ``INSTANCE_ID`` will be set to the current instance id for all run commands. Commands can be specified either as lists or strings. For invocation details, see ``runcmd``. .. note:: bootcmd should only be used for things that could not be done later in the boot process. .. note:: when writing files, do not use /tmp dir as it races with systemd-tmpfiles-clean LP: #1707222. Use /run/somedir instead. t descriptiontdistross bootcmd: - echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ] texamplest frequencytobjectttypetarraytstringtitemstoneOftadditionalItemstadditionalPropertiesitminItemstrequiredtbootcmdt propertiesc Cs?d|kr |jd|dSt|ttjdd}y7tj|d}|jtj||j Wn/t k r}tj |dt |nXy`t jj}|j} | rt | |d s>