??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó ßUdac@`sGddlmZmZmZeZidd6dgd6dd6ZdZd Zd Z dd l Z dd l Z dd l Z dd l Z dd lmZdd lmZmZddlmZddlmZddlmZddlmZddlmZdefd„ƒYZdefd„ƒYZd„ZedkrCeƒnd S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust communityt supported_bysô --- module: openssh_cert author: "David Kainz (@lolcube)" version_added: "2.8" short_description: Generate OpenSSH host or user certificates. description: - Generate and regenerate OpenSSH host or user certificates. requirements: - "ssh-keygen" options: state: description: - Whether the host or user certificate should exist or not, taking action if the state is different from what is stated. type: str default: "present" choices: [ 'present', 'absent' ] type: description: - Whether the module should generate a host or a user certificate. - Required if I(state) is C(present). type: str choices: ['host', 'user'] force: description: - Should the certificate be regenerated even if it already exists and is valid. type: bool default: false path: description: - Path of the file containing the certificate. type: path required: true signing_key: description: - The path to the private openssh key that is used for signing the public key in order to generate the certificate. - Required if I(state) is C(present). type: path public_key: description: - The path to the public key that will be signed with the signing key in order to generate the certificate. - Required if I(state) is C(present). type: path valid_from: description: - "The point in time the certificate is valid from. Time can be specified either as relative time or as absolute timestamp. Time will always be interpreted as UTC. Valid formats are: C([+-]timespec | YYYY-MM-DD | YYYY-MM-DDTHH:MM:SS | YYYY-MM-DD HH:MM:SS | always) where timespec can be an integer + C([w | d | h | m | s]) (e.g. C(+32w1d2h). Note that if using relative time this module is NOT idempotent." - Required if I(state) is C(present). type: str valid_to: description: - "The point in time the certificate is valid to. Time can be specified either as relative time or as absolute timestamp. Time will always be interpreted as UTC. Valid formats are: C([+-]timespec | YYYY-MM-DD | YYYY-MM-DDTHH:MM:SS | YYYY-MM-DD HH:MM:SS | forever) where timespec can be an integer + C([w | d | h | m | s]) (e.g. C(+32w1d2h). Note that if using relative time this module is NOT idempotent." - Required if I(state) is C(present). type: str valid_at: description: - "Check if the certificate is valid at a certain point in time. If it is not the certificate will be regenerated. Time will always be interpreted as UTC. Mainly to be used with relative timespec for I(valid_from) and / or I(valid_to). Note that if using relative time this module is NOT idempotent." type: str principals: description: - "Certificates may be limited to be valid for a set of principal (user/host) names. By default, generated certificates are valid for all users or hosts." type: list elements: str options: description: - "Specify certificate options when signing a key. The option that are valid for user certificates are:" - "C(clear): Clear all enabled permissions. This is useful for clearing the default set of permissions so permissions may be added individually." - "C(force-command=command): Forces the execution of command instead of any shell or command specified by the user when the certificate is used for authentication." - "C(no-agent-forwarding): Disable ssh-agent forwarding (permitted by default)." - "C(no-port-forwarding): Disable port forwarding (permitted by default)." - "C(no-pty Disable): PTY allocation (permitted by default)." - "C(no-user-rc): Disable execution of C(~/.ssh/rc) by sshd (permitted by default)." - "C(no-x11-forwarding): Disable X11 forwarding (permitted by default)" - "C(permit-agent-forwarding): Allows ssh-agent forwarding." - "C(permit-port-forwarding): Allows port forwarding." - "C(permit-pty): Allows PTY allocation." - "C(permit-user-rc): Allows execution of C(~/.ssh/rc) by sshd." - "C(permit-x11-forwarding): Allows X11 forwarding." - "C(source-address=address_list): Restrict the source addresses from which the certificate is considered valid. The C(address_list) is a comma-separated list of one or more address/netmask pairs in CIDR format." - "At present, no options are valid for host keys." type: list elements: str identifier: description: - Specify the key identity when signing a public key. The identifier that is logged by the server when the certificate is used for authentication. type: str serial_number: description: - "Specify the certificate serial number. The serial number is logged by the server when the certificate is used for authentication. The certificate serial number may be used in a KeyRevocationList. The serial number may be omitted for checks, but must be specified again for a new certificate. Note: The default value set by ssh-keygen is 0." type: int extends_documentation_fragment: files s> # Generate an OpenSSH user certificate that is valid forever and for all users - openssh_cert: type: user signing_key: /path/to/private_key public_key: /path/to/public_key.pub path: /path/to/certificate valid_from: always valid_to: forever # Generate an OpenSSH host certificate that is valid for 32 weeks from now and will be regenerated # if it is valid for less than 2 weeks from the time the module is being run - openssh_cert: type: host signing_key: /path/to/private_key public_key: /path/to/public_key.pub path: /path/to/certificate valid_from: +0s valid_to: +32w valid_at: +2w # Generate an OpenSSH host certificate that is valid forever and only for example.com and examplehost - openssh_cert: type: host signing_key: /path/to/private_key public_key: /path/to/public_key.pub path: /path/to/certificate valid_from: always valid_to: forever principals: - example.com - examplehost # Generate an OpenSSH host Certificate that is valid from 21.1.2001 to 21.1.2019 - openssh_cert: type: host signing_key: /path/to/private_key public_key: /path/to/public_key.pub path: /path/to/certificate valid_from: "2001-01-21" valid_to: "2019-01-21" # Generate an OpenSSH user Certificate with clear and force-command option: - openssh_cert: type: user signing_key: /path/to/private_key public_key: /path/to/public_key.pub path: /path/to/certificate valid_from: always valid_to: forever options: - "clear" - "force-command=/tmp/bla/foo" s¢ type: description: type of the certificate (host or user) returned: changed or success type: str sample: host filename: description: path to the certificate returned: changed or success type: str sample: /tmp/certificate-cert.pub info: description: Information about the certificate. Output of C(ssh-keygen -L -f). returned: change or success type: list elements: str N(tdatetime(tMINYEARtMAXYEAR(tcopy2(trmtree(t AnsibleModule(tconvert_relative_to_datetime(t to_nativetCertificateErrorcB`seZRS((t__name__t __module__(((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyRÖst CertificatecB`sSeZd„Zd„Zd„Zd„Zd„Zed„Zd„Z d„Z RS(cC`s†|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_|jd |_ |jd |_ |jd |_ |jd |_ |jd |_ t|_|j|_i|_|jdkrm|j r(|jdkr(|jddƒn|j rF|j jƒ|_ n|j jƒ|_ |j jƒ|_ n|jdtƒ|_dS(Ntstatetforcettypet signing_keyt public_keytpatht identifiert serial_numbert valid_fromtvalid_totvalid_att principalstoptionstpresentthosttmsgs0Options can only be used with user certificates.s ssh-keygen(tparamsRRRRRRRRRRRRR tFalsetchangedt check_modet cert_infot fail_jsontlstript get_bin_pathtTruet ssh_keygen(tselftmodule((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt__init__Üs0    c C`s¦|j|dtƒ s|jrr|jd|jg}d}|jdkoU|jdksö|jdks |j||jƒ}|t|j ƒj dƒt|j ƒj dƒt|j ƒj dƒt|j ƒj dƒt|jƒj dƒt|jƒj dƒ7}n |d7}|d 7}|jdkrAttd d ƒ}n|j||jƒ}|t|j ƒj dƒt|j ƒj dƒt|j ƒj dƒt|j ƒj dƒt|jƒj dƒt|jƒj dƒ7}|jd |gƒn|jd kr|jdgƒn|jr:|jd|jgƒn|jddgƒ|jdk r{|jdt|jƒgƒn|jr¦|jddj|jƒgƒn|jræx4|jD]&}|jdgƒ|j|gƒq¹Wn|jddgƒyñtjƒ}t|j|ƒ|j|dtjj |jƒgƒ|j!|dt"ddƒdt#ƒt|dtjj$tjj |jƒƒdd|jƒt%|dt#ƒ|j!|jdd|jgƒ}|dj&ƒ|_'t#|_(Wqrt)k rn}y|j*ƒt%|dt#ƒWn4t+k rP} | j,t,j-krQt.| ƒ‚qQnX|j/d d!t0|ƒƒqrXn|j1|j2ƒ} |j3| tƒr¢t#|_(ndS("Ntperms_requireds-sttalwaystforeveriit19700101010101t:i is-VR"s-hs-Is-zs-nt,s-Os-Pt/tenviron_updatetTZtUTCtcheck_rcis -cert.pubt ignore_errorss-Ls-fiR#s%s(4tis_validR%RR-RRRtconvert_to_datetimetstrtyeartzfilltmonthtdaythourtminutetsecondRR textendRRRtNoneRtjoinR ttempfiletmkdtempR RtosRtbasenamet run_commandtdictR,tsplitextR tsplitR(R&t ExceptiontremovetOSErrorterrnotENOENTRR)Rtload_file_common_argumentsR$tset_fs_attributes_if_different( R.R/targstvalidityttimeobjtoptionttemp_directorytproctetexct file_args((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pytgenerateûsnm  m  "  '";!  !cC`s¥|j|ƒrEt|ƒ}|dkr>|jdd|ƒq¡|Sn\dddg}x6|D].}ytj||ƒSWq[tk rˆq[Xq[W|jdd|ƒdS(NR#s '%s' is not a valid time format.s%Y-%m-%ds%Y-%m-%d %H:%M:%Ss%Y-%m-%dT%H:%M:%Ss'%s' is not a valid time format(t is_relativeRRIR)Rtstrptimet ValueError(R.R/t timestringtresulttformatstfmt((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyR?Us      cC`s&|jdƒs|jdƒr"tStS(Nt+t-(t startswithR,R%(R.ttimestr((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyRdjscC`sJd„}y||jƒdkSWn"tk rE|||ƒdkSXdS(NcS`s)|jd|j|jddddS(Ngiii ii@Bi@B(t microsecondstsecondstdays(t time_delta((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyttimedelta_total_secondsrsg(t total_secondstAttributeError(R.t datetime_onet datetime_twoRs((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pytis_same_datetimeos   c `sćfd†}|ƒr0|jˆjddˆjgdtddƒdtƒ}|ddkrbtS|d jƒˆ_tjd |d tj ƒdjƒ‰t t t j ˆƒƒ‰ˆd gkrËd‰ntjd |d ƒdj ƒ‰tjd |d ƒjd ƒ‰tjd|d ƒ}|r |dd r„ˆj||dd ƒ‰ˆjˆˆj|dƒƒr–ttd d ƒ‰q–nttd d ƒ‰|ddrôˆj||ddƒ‰ˆjˆˆj|dƒƒrttddƒ‰qq-ttddƒ‰q4ttd d ƒ‰ttddƒ‰ntSd„}‡‡fd†}‡‡fd†}‡‡fd†} ‡‡‡fd†} |rŸ||ƒ rŸtS|ƒoÃ| ƒoÃ| |ƒoÃ|ƒS(Nc`stjjˆjƒS(N(RMRtexists((R.(sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt _check_state|ss-Ls-fR9R:R;R<iis (?<=Principals:)(.*)(?=Critical)s(none)s( user | host )s Serial: (\d+)sS(from (\d{4}-\d{2}-\d{2}T\d{2}(:\d{2}){2}) to (\d{4}-\d{2}-\d{2}T\d{2}(:\d{2}){2}))s1970-01-01 01:01:01is2038-01-19 03:14:07i icS`s#|j|jƒ}|j|tƒ S(N(RXR$RYR%(R/Rb((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt _check_permsŸsc`s&ˆjdkrtSˆjtˆƒkS(N(RRIR,tint((R.R(sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt_check_serial_number£sc`s ˆjˆkS(N(R((t cert_typeR.(sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt _check_type¨sc`s7ˆ sˆj rˆjˆkStˆjƒtˆƒkS(N(Rtset((RR.(sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt_check_principals«s c`s5ˆjdkr$ttddƒ}n0ˆjˆjƒr?d}nˆj|ˆjƒ}ˆjdkrxttddƒ}n0ˆjˆjƒr“d}nˆj|ˆjƒ}|rLjj|ˆƒsÇt Sn|ræˆj|ˆƒsæt Snˆj r!ˆˆj|ˆj ƒkoˆknr!t Sn|r1|r1t St S(NR3iR4i i( RRR RdRIR?RR RxR%RR,(R/t earliest_timet last_time(tcert_valid_fromt cert_valid_toR.(sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt_check_validity°s,   + (ROR-RRPR%RRR(tretfindalltStlisttmapR@tstripRItsearchtgroupR?RxRR R ( R.R/R1RzR_R[R{R}RRR†((R~R„R…RR.RsG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyR>zsF 6&   c`sod„‰‡‡fd†}ˆjdkr[iˆjd6ˆjd6ˆjd6|ƒd6}niˆjd6}|S(s'Serialize the object into a dictionary.cS`skg}d}x>|D]6}||kr;|j|ƒ|}q|d|7}qW|j|ƒ|jdƒ|S(NR2t i(tappendtpop(tarrtkeywordstconcatedtstringtword((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pytfilter_keywordsØs      c `s+ˆˆjddddddddd g ƒS( NsType:tPublictSigningtKeysSerial:sValid:s Principals:tCriticals Extensions:(R(((R—R.(sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pytformat_cert_infoæs R!R&Rtfilenametinfo(RR&RR(R.RœRh((R—R.sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pytdumpÔs      cC`sXytj|jƒt|_Wn4tk rS}|jtjkrTt|ƒ‚qTnXdS(s(Remove the resource from the filesystem.N( RMRTRR,R&RURVRWR(R.Ra((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyRTs ( RRR0RcR?RdRxR,R>RŸRT(((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyRÚs  Z   Z ,c!`s«tdtdtdddddddgƒd tdd dtƒdtdddd d gƒd tddƒdtddƒdtdddtƒdtddƒdtddƒdtddƒdtddƒdtddƒdtddddƒdtddddƒƒ dtdtddddd dddgfgƒ‰‡fd†}ˆjddkr|ˆjd ƒ|ˆjdƒn|ˆjdƒtˆƒ}|jdkrˆjr׈jd pÎ|jˆƒ |_ qŽy|j ˆƒWqŽt k r}ˆj dt |ƒƒqŽXnwˆjrTtjjˆjdƒ|_ |j rŽi|_qŽn:y|jƒWn)t k r}ˆj dt |ƒƒnX|jƒ}ˆj|dS( Nt argument_specRRR@tdefaultR!tchoicestabsentRtboolR"tuserRRRtrequiredRRR|RRRRRŠtelementsR tsupports_check_modetadd_file_common_argst required_ifc`sKtjj|ƒpd}tjj|ƒsGˆjd|dd|ƒndS(Nt.tnameR#s>The directory %s does not exist or the file is not a directory(RMRtdirnametisdirR)(Rtbase_dir(R/(sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyt isBaseDir$s  R#(R RPR%R,R$RRR'R>R&RcRSR)RRMRRyR(RTRŸt exit_json(R°t certificateRaRh((R/sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pytmain sR!$  #   t__main__( t __future__RRRRt __metaclass__tANSIBLE_METADATAt DOCUMENTATIONtEXAMPLEStRETURNRMRVR‡RKRR R tshutilR R tansible.module_utils.basicR tansible.module_utils.cryptoRtansible.module_utils._textRRSRtobjectRR³R(((sG/usr/lib/python2.7/site-packages/ansible/modules/crypto/openssh_cert.pyts2  m8    ÿ4 @