??????????????
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@`seddlmZmZmZeZdZdZdZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZmZddlmZmZmZddlmZdd lmZdd lmZmZmZdd lmZd Ze dƒZ!d„Z"d„Z#d„Z$d„Z%dd„Z'd„Z(d„Z)d„Z*defd„ƒYZ+dS(i(tabsolute_importtdivisiontprint_functions® lookup: password version_added: "1.1" author: - Daniel Hokka Zakrisson - Javier Candeira - Maykel Moya short_description: retrieve or generate a random password, stored in a file description: - Generates a random plaintext password and stores it in a file at a given filepath. - If the file exists previously, it will retrieve its contents, behaving just like with_file. - 'Usage of variables like C("{{ inventory_hostname }}") in the filepath can be used to set up random passwords per host, which simplifies password management in C("host_vars") variables.' - A special case is using /dev/null as a path. The password lookup will generate a new random password each time, but will not write it to /dev/null. This can be used when you need a password without storing it on the controller. options: _terms: description: - path to the file that stores/will store the passwords required: True encrypt: description: - Which hash scheme to encrypt the returning password, should be one hash scheme from C(passlib.hash). - If not provided, the password will be returned in plain text. - Note that the password is always stored as plain text, only the returning password is encrypted. - Encrypt also forces saving the salt value for idempotence. - Note that before 2.6 this option was incorrectly labeled as a boolean for a long time. chars: version_added: "1.4" description: - Define comma separated list of names that compose a custom character set in the generated passwords. - 'By default generated passwords contain a random mix of upper and lowercase ASCII letters, the numbers 0-9 and punctuation (". , : - _").' - "They can be either parts of Python's string module attributes (ascii_letters,digits, etc) or are used literally ( :, -)." - "To enter comma use two commas ',,' somewhere - preferably at the end. Quotes and double quotes are not supported." type: string length: description: The length of the generated password. default: 20 type: integer notes: - A great alternative to the password lookup plugin, if you don't need to generate random passwords on a per-host basis, would be to use Vault in playbooks. Read the documentation there and consider using it first, it will be more desirable for most applications. - If the file already exists, no data will be written to it. If the file has contents, those contents will be read in as the password. Empty files cause the password to return as an empty string. - 'As all lookups, this runs on the Ansible host as the user running the playbook, and "become" does not apply, the target file must be readable by the playbook user, or, if it does not exist, the playbook user must have sufficient privileges to create it. (So, for example, attempts to write into areas such as /etc will fail unless the entire playbook is being run as root).' s% - name: create a mysql user with a random password mysql_user: name: "{{ client }}" password: "{{ lookup('password', 'credentials/' + client + '/' + tier + '/' + role + '/mysqlpassword length=15') }}" priv: "{{ client }}_{{ tier }}_{{ role }}.*:ALL" - name: create a mysql user with a random password using only ascii letters mysql_user: name: "{{ client }}" password: "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}" priv: '{{ client }}_{{ tier }}_{{ role }}.*:ALL' - name: create a mysql user with an 8 character random password using only digits mysql_user: name: "{{ client }}" password: "{{ lookup('password', '/tmp/passwordfile length=8 chars=digits') }}" priv: "{{ client }}_{{ tier }}_{{ role }}.*:ALL" - name: create a mysql user with a random password using many different char sets mysql_user: name: "{{ client }}" password: "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters,digits,hexdigits,punctuation') }}" priv: "{{ client }}_{{ tier }}_{{ role }}.*:ALL" s' _raw: description: - a password N(t AnsibleErrortAnsibleAssertionError(tto_bytest to_nativetto_text(tparse_kv(t LookupBase(t do_encrypttrandom_passwordt random_salt(t makedirs_safeitlengthtencrypttcharscC`s¬|jddƒ}t|ƒdkr6|}tƒ}ng|d}t|dƒ}d|krdj||dfƒ}|d=|j|ƒstdƒ‚qnt|jƒƒj t ƒ}|rÚtddj|ƒƒ‚nt |j d t ƒƒ|d <|j d dƒ|d <|j d dƒ|d <|d rg}d |d krR|jd ƒn|jd„|d jd d ƒjd ƒDƒƒ||d šsu ascii_lettersudigitsu.,:-_N(tsplittlentdictRtjoint startswithRt frozensettkeyst differencet VALID_PARAMStinttgettDEFAULT_LENGTHtNonetappendtextendtreplace(ttermt first_splittrelpathtparamstinvalid_paramst tmp_chars((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt_parse_parametersqs2    0 cC`s[d}tjj|ƒrWt|dƒ}|jƒjƒ}WdQXt|ddƒ}n|S(sùRead the contents of a password file and return it :arg b_path: A byte string containing the path to the password file :returns: a text string containing the contents of the password file or None if no password file was present. trbNterrorstsurrogate_or_strict(R!tostpathtexiststopentreadtrstripR(tb_pathtcontenttft b_content((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt_read_password_file£s cC`smg}x9|D]1}|jtttt|ƒ|ƒddƒƒq Wdj|ƒjddƒjddƒ}|S(shGenerate a string containing all valid chars as defined by ``characters`` :arg characters: A list of character specs. The character specs are shorthand names for sets of characters like 'digits', 'ascii_letters', or 'punctuation' or a string to be included verbatim. The values of each char spec can be: * a name of an attribute in the 'strings' module ('digits' for example). The value of the attribute will be added to the candidate chars. * a string of characters. If the string isn't an attribute in 'string' module, the string will be directly added to the candidate chars. For example:: characters=['digits', '?|']`` will match ``string.digits`` and add all ascii digits. ``'?|'`` will add the question mark and pipe characters directly. Return will be the string:: u'0123456789?|' R-tstrictuu"u'(R"RtgetattrtstringRRR$(t charactersRt chars_spec((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt_gen_candidate_chars³s  !'cC`sa|}d}d}y|j|ƒ}Wntk r8nX||t|ƒ}|| }||fS(s‰parse our password data format into password and salt :arg content: The data read from the file :returns: password and salt u salt=N(R!trindext ValueErrorR(R6tpasswordtsaltt salt_slugtsep((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt_parse_contentÔs  cC`s5| r| r|S|s'tdƒ‚nd||fS(sJFormat the password and salt for saving :arg password: the plaintext password to save :arg salt: the salt to use when encrypting a password :arg encrypt: Which method the user requests that this password is encrypted. Note that the password is saved in clear. Encrypt just tells us if we must save the salt value for idempotence. Defaults to None. :returns: a text string containing the formatted information .. warning:: Passwords are saved in clear. This is because the playbooks expect to get cleartext passwords from this lookup. sF_format_content was called with encryption requested but no salt valueu %s salt=%s(R(RBRCR((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt_format_contentês cC`sqtjj|ƒ}t|ddƒt|dƒ:}tj|dƒt|ddƒd}|j|ƒWdQXdS(NtmodeiÀtwbi€R-R.s (R/R0tdirnameR R2tchmodRtwrite(R5R6t b_pathdirR7R8((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt_write_password_files cC`sLt}tjj|ƒ}tdtj|ƒjƒƒ}tjj||ƒ}tjj |ƒ râ|tdƒkrâyCt |ddƒtj |tj tj Bƒ}tj|ƒt}Wqâtk rÞ}|jdkrß‚qßqâXnd}xWtjj |ƒrA| rAtjd|ƒ|dkr4td|ƒ‚n|d 7}qëW||fS( s'Get the lock for writing password file.s%s.ansible_lockfiles /dev/nullRHiÀs File existsiis¦Password lookup cannot get the lock in 7 seconds, abort...This may caused by un-removed lockfileyou can manually remove it from controller machine at %s and try againi(tFalseR/R0RJRthashlibtsha1t hexdigestRR1R R2tO_CREATtO_EXCLtclosetTruetOSErrortstrerrorttimetsleepR(R5t first_processRMt lockfile_nametlockfiletfdtetcounter((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt _get_lock s*%     cC`s&tjj|ƒr"tj|ƒndS(s?Release the lock so other processes can read the password file.N(R/R0R1tremove(R]((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyt _release_lock&st LookupModulecB`seZd„ZRS(c K`sŽg}x|D]y}t|ƒ\}}|jj|ƒ}t|ddƒ} t|dƒ} d} t| ƒ\} } t| ƒ}|dks›| tdƒkr½t|d| ƒ}d}t } nt |ƒ\}}|drò| ròt } t ƒ}n| r3| tdƒkr3t ||d|dƒ}t | |ƒn| rFt| ƒn|dryt||dd|ƒ}|j|ƒq |j|ƒq W|S(NR-R.Rs /dev/nullRRRC(R+t_loadert path_dwimRR?R!RaR9R RVRFR RGRNRcR R"(tselfttermst variablestkwargstretR%R'R(R0R5RtchangedR[R]R6tplaintext_passwordRCRB((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pytrun-s6      (t__name__t __module__Rn(((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyRd,s(slengthsencryptschars(,t __future__RRRttypet __metaclass__t DOCUMENTATIONtEXAMPLEStRETURNR/R<RYtshutilRPtansible.errorsRRtansible.module_utils._textRRRtansible.parsing.splitterRtansible.plugins.lookupR tansible.utils.encryptR R R tansible.utils.pathR R RRR+R9R?RFR!RGRNRaRcRd(((sC/usr/lib/python2.7/site-packages/ansible/plugins/lookup/password.pyts46       2  !