܍~c4 tUdZddlZddlZddlmZddlmZddlmZddl Z ddl m Z m Z m Z mZmZddlmZddlmZdd lmZmZdd lmZmZdd lmZd Zd gZdZdddeegeededgdgdZee d<eeZGddZ!dZ"dZ#edddfdefdZ$de%ded ed!ed"e&d#df d$Z'dS)%z+Puppet: Install, configure and start puppetN)StringIO)Logger)dedent)helperssubp temp_utils url_helperutil)Cloud)Config) MetaSchema get_meta_doc) ALL_DISTROSDistro) PER_INSTANCEzKhttps://raw.githubusercontent.com/puppetlabs/install-puppet/main/install.shz--testa>This module handles puppet installation and configuration. If the ``puppet`` key does not exist in global configuration, no action will be taken. If a config entry for ``puppet`` is present, then by default the latest version of puppet will be installed. If the ``puppet`` config key exists in the config archive, this module will attempt to start puppet even if no installation was performed. The module also provides keys for configuring the new puppet 4 paths and installing the puppet package from the puppetlabs repositories: https://docs.puppet.com/puppet/4.2/reference/whered_it_go.html The keys are ``package_name``, ``conf_file``, ``ssl_dir`` and ``csr_attributes_path``. If unset, their values will default to ones that work with puppet 3.x and with distributions that ship modified puppet 4.x that uses the old paths. cc_puppetPuppetz#Install, configure and start puppeta` puppet: install: true version: "7.7.0" install_type: "aio" collection: "puppet7" aio_install_url: 'https://git.io/JBhoQ' cleanup: true conf_file: "/etc/puppet/puppet.conf" ssl_dir: "/var/lib/puppet/ssl" csr_attributes_path: "/etc/puppet/csr_attributes.yaml" exec: true exec_args: ['--test'] conf: agent: server: "puppetserver.example.org" certname: "%i.%f" ca_cert: | -----BEGIN CERTIFICATE----- MIICCTCCAXKgAwIBAgIBATANBgkqhkiG9w0BAQUFADANMQswCQYDVQQDDAJjYTAe Fw0xMDAyMTUxNzI5MjFaFw0xNTAyMTQxNzI5MjFaMA0xCzAJBgNVBAMMAmNhMIGf MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu7Q40sm47/E1Pf+r8AYb/V/FWGPgc b014OmNoX7dgCxTDvps/h8Vw555PdAFsW5+QhsGr31IJNI3kSYprFQcYf7A8tNWu 1MASW2CfaEiOEi9F1R3R4Qlz4ix+iNoHiUDTjazw/tZwEdxaQXQVLwgTGRwVa+aA qbutJKi93MILLwIDAQABo3kwdzA4BglghkgBhvhCAQ0EKxYpUHVwcGV0IFJ1Ynkv T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwDwYDVR0TAQH/BAUwAwEB/zAd BgNVHQ4EFgQUu4+jHB+GYE5Vxo+ol1OAhevspjAwCwYDVR0PBAQDAgEGMA0GCSqG SIb3DQEBBQUAA4GBAH/rxlUIjwNb3n7TXJcDJ6MMHUlwjr03BDJXKb34Ulndkpaf +GAlzPXWa7bO908M9I8RnPfvtKnteLbvgTK+h+zX1XCty+S2EQWk29i2AdoqOTxb hppiGMp0tT5Havu4aceCXiy2crVcudj3NFciy8X66SoECemW9UYDCb9T5D0d -----END CERTIFICATE----- csr_attributes: custom_attributes: 1.2.840.113549.1.9.7: 342thbjkt82094y0uthhor289jnqthpc2290 extension_requests: pp_uuid: ED803750-E3C7-44F5-BB08-41A04433FE2E pp_image_name: my_ami_image pp_preshared_key: 342thbjkt82094y0uthhor289jnqthpc2290 z puppet: install_type: "packages" package_name: "puppet" exec: false puppet)idnametitle descriptiondistros frequencyexamplesactivate_by_schema_keysmetaceZdZdZdS)PuppetConstantsc||_||_tj|d|_tj|jd|_||_dS)Ncertszca.pem) conf_pathssl_dirospathjoin ssl_cert_dir ssl_cert_pathcsr_attributes_path)selfpuppet_conf_filepuppet_ssl_dirr)logs zhandle..s CCCCCCr0 )sourceca_certicertnamez%fz%iz%s.old)default_flow_stylezRunning puppet-agentagent exec_argszOUnknown type %s provided for puppet 'exec_args' expected list, tuple, or stringr8)servicerstart)/debugr get_cfg_option_boolget_cfg_option_strAIO_INSTALL_URLr@rKinstall_packagesr_rJr load_filer"rDefaultingConfigParser splitlinesr& read_fileritems ensure_dirr# chownbynamer'rWr(replacesocketgetfqdnget_instance_idlowersetrename stringifyr)yamldumprA isinstancelisttupleextendstrsplittypePUPPET_AGENT_DEFAULT_ARGSr)rr`rar-r[ puppet_cfgrdrXrYrerZrun start_puppetdrj puppet_userrFpuppet_packagermror#r) p_constantsrT puppet_config cleaned_linescleaned_contentscfg_nameovcmdcmd_argss r.handlersXs G    XJ&z9dCCG%j)TBBG(\4HHJ*NJL&z9dCCG  ":vu E E EC,OTM-%O u 1 '  !*NNL w N      5 ,GGH    : % % L ) )<*A B B B B U " "  ow G     KK:L I I IC'K!1*h!G!GI%I/ HEEG1%566 ")W6I3OOK>+"788688 DCX-@-@-B-BCCC 99]33 % & &{/D     *&17799! N! NOXs9$$ 3U;;; !4k6JJJ 8999 !9;OOO 93??? -{F "iikk 6 6FQJIIdFN,<,<==IIdE,A,A,C,CDDGGII!%%h15555 K%x;3H'I    OK1=3J3J3L3L M M M M:%%   + Ij!12u M M M   # & ()))7# * $ $!+.H(T5M22 6 8$$$$Hc** 6 8>>++,,,, !NN   45555 JJ0 1 1 1 #u%%%%A 000%@@@@@@AAr0)(__doc__r$riorloggingrtextwraprr cloudinitrrrr r cloudinit.cloudr cloudinit.configr cloudinit.config.schemar rcloudinit.distrosrrcloudinit.settingsrrrMODULE_DESCRIPTIONr__annotations__rrArJr_rrrr4r0r.rsa211  AAAAAAAAAAAAAA!!!!!!######<<<<<<<<11111111++++++_%J$   2%}& ( ( R    U2f!)zu;;j;;;z ,t  77777777   .    !7!7 !7!7!7!7H^A ^A^A#(^A/5^A=A^A ^A^A^A^A^A^Ar0