fd "UdZddlZddlZddlZddlmZddlmZddlm Z m Z ddl m Z ddl mZddlmZmZdd lmZd Zd Zd Zd ZdgZdddeeedgedgdZeed<eeZej6eZeeefdZdedede de ddf dZ!y)z6 Mcollective: Install, configure and start mcollectiveN)dedent) ConfigObj)subputil)Cloud)Config) MetaSchema get_meta_doc) PER_INSTANCEz&/etc/mcollective/ssl/server-public.pemz'/etc/mcollective/ssl/server-private.pemz/etc/mcollective/server.cfgaThis module installs, configures and starts mcollective. If the ``mcollective`` key is present in config, then mcollective will be installed and started. Configuration for ``mcollective`` can be specified in the ``conf`` key under ``mcollective``. Each config value consists of a key value pair and will be written to ``/etc/mcollective/server.cfg``. The ``public-cert`` and ``private-cert`` keys, if present in conf may be used to specify the public and private certificates for mcollective. Their values will be written to ``/etc/mcollective/ssl/server-public.pem`` and ``/etc/mcollective/ssl/server-private.pem``. .. note:: The ec2 metadata service is readable by non-root users. If security is a concern, use include-once and ssl urls. allcc_mcollective Mcollectivez(Install, configure and start mcollectivea # Provide server private and public key and provide the following # config settings in /etc/mcollective/server.cfg: # loglevel: debug # plugin.stomp.host: dbhost # WARNING WARNING WARNING # The ec2 metadata service is a network service, and thus is # readable by non-root users on the system # (ie: 'ec2metadata --user-data') # If you want security for this, please use include-once + SSL urls mcollective: conf: loglevel: debug plugin.stomp.host: dbhost public-cert: | -------BEGIN CERTIFICATE-------- -------END CERTIFICATE-------- private-cert: | -------BEGIN CERTIFICATE-------- -------END CERTIFICATE-------- mcollective)idnametitle descriptiondistrosexamples frequencyactivate_by_schema_keysmetac tj|d}ttj|}|jD]\}}|dk(r#tj||d||d<d|d <.|d k(r#tj||d ||d <d|d <Vt|tr|||<lt|tr4||jvri||<|jD] \} } | ||| <t|||< tj |d |ztj} |j#| tj|| j%dy#t $rI}|j t jk7rtjd|t}Yd}~d}~wwxYw#t $r)}|j t jk(rnYd}~d}~wwxYw)NF)quietz4Did not find file %s (starting with an empty config)z public-certi)modezplugin.ssl_server_publicsslsecurityproviderz private-certizplugin.ssl_server_privatez%s.old)rload_binary_filerioBytesIOIOErrorerrnoENOENTLOGdebugitems write_file isinstancestrdictsectionscopywritegetvalue) config server_cfg pubcert_file pricert_file old_contentsmcollective_configecfg_namecfgovcontentss A/usr/lib/python3/dist-packages/cloudinit/config/cc_mcollective.py configurer<\s -,,ZuE &rzz,'?@ 8 # } $ OOL#E :=I 9 :5: 1 2  ' OOL#E :>J : ;5: 1 2#s#/2"8,C$(#5#>#>>35&x0IIK8DAq67&x038033x"8,-80  *h*56zz|HX&OOJ 1 1 3%@_ - 77ell "  IIF "+ -J  77ell "   s/5E-G- F?6>F::F? G4 G//G4rr7cloudargsreturncd|vrtjd|y|d}|jjdgd|vrt |dt j gddy)Nrz?Skipping module named %s, no 'mcollective' key in configurationconf)r/)servicerrestartF)capture)r$r%distroinstall_packagesr<r)rr7r=r>mcollective_cfgs r;handlerHsiC M   -(O LL!!=/2 01 II3UC)"__doc__r"rloggingtextwrapr configobjr cloudinitrrcloudinit.cloudrcloudinit.configrcloudinit.config.schemar r cloudinit.settingsr PUBCERT_FILE PRICERT_FILE SERVER_CFGMODULE_DESCRIPTIONrr__annotations__ getLogger__name__r$r<r)listrHrIr;r\s=  !#<+7 8 * " '   7%  8 -G$j$L t g!  :AzDD6D%DtDDrI