PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  oB]c@sdZddlZddlZddlZddlmZddlmZddlm Z eZ dZ dZ dZ ejeZd Zd Zd Zd Zd ZdS(sW Write Files ----------- **Summary:** write arbitrary files Write out arbitrary content to files, optionally setting permissions. Content can be specified in plain text or binary. Data encoded with either base64 or binary gzip data can be specified and will be decoded before being written. .. note:: if multiline data is provided, care should be taken to ensure that it follows yaml formatting standards. to specify binary data, use the yaml option ``!!binary`` .. note:: Do not write files under /tmp during boot because of a race with systemd-tmpfiles-clean that can cause temp files to get cleaned during the early boot process. Use /run/somedir instead to avoid race LP:1707222. **Internal name:** ``cc_write_files`` **Module frequency:** per instance **Supported distros:** all **Config keys**:: write_files: - encoding: b64 content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV4... owner: root:root path: /etc/sysconfig/selinux permissions: '0644' - content: | # My new /etc/sysconfig/samba file SMDBOPTIONS="-D" path: /etc/sysconfig/samba - content: !!binary | f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAwARAAAAAAABAAAAAAAAAAJAVAAAAAA AEAAHgAdAAYAAAAFAAAAQAAAAAAAAABAAEAAAAAAAEAAQAAAAAAAwAEAAAAAAA AAAAAAAAAwAAAAQAAAAAAgAAAAAAAAACQAAAAAAAAAJAAAAAAAAcAAAAAAAAAB ... path: /bin/arch permissions: '0555' - content: | 15 * * * * root ship_logs path: /etc/crontab append: true iN(tlog(t PER_INSTANCE(tutils root:rootis text/plaincCs:|jd}|s)|jd|dSt||dS(Nt write_filessESkipping module named %s, no/empty 'write_files' key in configuration(tgettdebugR(tnametcfgt_cloudRt_argstfiles((sC/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pythandleLs  cCs|sd}n|jj}|d kr4dgS|dkrJd dgS|dkr]d gS|rytjd |tntgS(Nttgztgzipsapplication/x-gzips gz+base64s gzip+base64sgz+b64sgzip+b64sapplication/base64tb64tbase64s%Unknown encoding type %s, assuming %s(R R(s gz+base64s gzip+base64sgz+b64sgzip+b64(Rsbase64(tlowertstriptLOGtwarningt UNKNOWN_ENC(t encoding_type((sC/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pytcanonicalize_extractionUs       c Cs%|s dSxt|D]\}}|jd}|sUtjd|d|qntjj|}t|jd}t|jdd|}t j |jdt \}}t |jdt } t j|d rd nd } t j||d | d | t j|||qWdS(Ntpaths3No path provided to write for entry %s in module %sitencodingtcontentR townert permissionstappendtabtwbtomodetmode(t enumerateRRRtosRtabspathRtextract_contentsRtextract_usergroupt DEFAULT_OWNERt decode_permst DEFAULT_PERMStget_cfg_option_boolt write_filet chownbyname( RR titf_infoRt extractionstcontentstutgtpermsR ((sC/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyRis  !cCs|dkr|Sy:t|tjtfr6t|Stt|dSWnttfk rg}xN||fD]@}y|j d|Wqstk r|j d|qsXqsWt j d||SXdS(Nis%os%rs0Undecodable permissions %s, returning default %s( tNonet isinstancetsixt integer_typestfloattinttstrt TypeErrort ValueErrorRRR(tpermtdefaulttrepstr((sC/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyR(}s     cCsr|}xe|D]]}|dkr=tj|dtdt}q |dkr[tj|}q |tkr q q W|S(Nsapplication/x-gziptquiettdecodesapplication/base64(Rt decomp_gziptFalseRt b64decodeR(R0textraction_typestresulttt((sC/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyR%s    (t__doc__RR#R6t cloudinitRtloggingtcloudinit.settingsRRt frequencyR'R)Rt getLoggert__name__RR RRR(R%(((sC/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyt8s