??????????????
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@`sþddlmZmZmZeZdZdZdZddl Z ddl m Z ddl m Z ddlmZeZyddlZeZWnek r¥eZnXd Ze jd ƒdk rÑe jd Znd dd „ƒYZd efd„ƒYZdS(i(tabsolute_importtdivisiontprint_functions lookup: hashi_vault author: Jonathan Davila version_added: "2.0" short_description: retrieve secrets from HashiCorp's vault requirements: - hvac (python library) description: - retrieve secrets from HashiCorp's vault notes: - Due to a current limitation in the HVAC library there won't necessarily be an error if a bad endpoint is specified. options: secret: description: query you are making. required: True token: description: vault token. env: - name: VAULT_TOKEN url: description: URL to vault service. env: - name: VAULT_ADDR default: 'http://127.0.0.1:8200' username: description: Authentication user name. password: description: Authentication password. role_id: description: Role id for a vault AppRole auth. env: - name: VAULT_ROLE_ID secret_id: description: Secret id for a vault AppRole auth. env: - name: VAULT_SECRET_ID auth_method: description: - Authentication method to be used. - C(userpass) is added in version 2.8. env: - name: VAULT_AUTH_METHOD choices: - userpass - ldap - approle mount_point: description: vault mount point, only required if you have a custom mount point. default: ldap ca_cert: description: path to certificate to use for authentication. aliases: [ cacert ] validate_certs: description: controls verification and validation of SSL certificates, mostly you only want to turn off with self signed ones. type: boolean default: True namespace: version_added: "2.8" description: namespace where secrets reside. requires HVAC 0.7.0+ and Vault 0.11+. sA - debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hello:value token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200')}}" - name: Return all secrets from a path debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200')}}" - name: Vault that requires authentication via LDAP debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hello:value auth_method=ldap mount_point=ldap username=myuser password=mypas url=http://myvault:8200')}}" - name: Vault that requires authentication via username and password debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hello:value auth_method=userpass username=myuser password=mypas url=http://myvault:8200')}}" - name: Using an ssl vault debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hola:value token=c975b780-d1be-8016-866b-01d0f9b688a5 url=https://myvault:8200 validate_certs=False')}}" - name: using certificate auth debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hi:value token=xxxx-xxx-xxx url=https://myvault:8200 validate_certs=True cacert=/cacert/path/ca.pem')}}" - name: authenticate with a Vault app role debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hello:value auth_method=approle role_id=myroleid secret_id=mysecretid url=http://myvault:8200')}}" - name: Return all secrets from a path in a namespace debug: msg: "{{ lookup('hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200 namespace=teama/admins')}}" # to work with kv v2 (vault api - for kv v2 - GET method requires that PATH should be "secret/data/:path") - name: Return all kv v2 secrets from a path debug: msg: "{{ lookup('hashi_vault', 'secret=secret/data/hello token=my_vault_token url=http://myvault_url:8200') }}" s1 _raw: description: - secrets(s) requested N(t AnsibleError(tboolean(t LookupBaseshttp://127.0.0.1:8200t VAULT_ADDRt HashiVaultcB`sGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(c K`sH|jdtƒ|_|jddƒ|_dddg|_|jdƒ}|dkrftdƒ‚n|jdd ƒ}|d |_t |ƒd kr§|d |_ n d |_ |j |jd t ƒ|jdd ƒƒ|_ |jdtjjdƒƒ|_|j |jd t ƒ|jdd ƒƒ|_ |jrñ|jdkrñy{|jdk r‚tjd|jd|j d|jƒ|_n!tjd|jd|j ƒ|_t|d|jƒ|Wq&tk rítd|j|jfƒ‚q&Xn5|jdtjjddƒƒ|_|jdkr™tjjdƒr™tjjtjjdƒdƒ}tjj|ƒr™t|ƒ}|jƒjƒ|_WdQXq™n|jdkr·tdƒ‚n|jdk rütjd|jd|jd|j d|jƒ|_n*tjd|jd|jd|j ƒ|_|jjƒsDtdƒ‚ndS(Nturlt namespacetapproletuserpasstldaptsecrets*No secret specified for hashi_vault lookupt:iiittvalidate_certstcacertt auth_methodtVAULT_AUTH_METHODttokentverifytauth_sBAuthentication method '%s' not supported. Available options are %rt VAULT_TOKENtHOMEs .vault-tokensNo Vault Token specifieds>Invalid Hashicorp Vault Token Specified for hashi_vault lookup(tgettANSIBLE_HASHI_VAULT_ADDRRtNoneR tavail_auth_methodRtrsplitR tlent secret_fieldtboolean_or_cacerttTrueRtostenvironRthvactClienttclienttgetattrtAttributeErrorRtpathtjointexiststopentreadtstriptis_authenticated(tselftkwargststs_fttoken_filenamet token_file((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyt__init__ˆsL   -!--! $!  !6*cC`s|jj|jƒ}|dkr7td|jƒ‚n|jdkrN|dS|j|dkr€td|j|jfƒ‚n|d|jS(Ns:The secret %s doesn't seem to exist for hashi_vault lookupRtdatasEThe secret %s does not contain the field '%s'. for hashi_vault lookup(R&R-R RRR(R0R7((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyRÅs cK`s~|jdƒ}|dkr1td|jƒ‚n|jdƒ}|dkrbtd|jƒ‚n|jdƒ}|||fS(Ntusernames,Authentication method %s requires a usernametpasswords,Authentication method %s requires a passwordt mount_point(RRRR(R0R1R8R9R:((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyt check_paramsÓs  cK`sJ|j|\}}}|dkr-d}n|jj||d|ƒdS(NR R:(R;RR&t auth_userpass(R0R1R8R9R:((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyR<às  cK`sJ|j|\}}}|dkr-d}n|jj||d|ƒdS(NR R:(R;RR&t auth_ldap(R0R1R8R9R:((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyR=çs  cC`s=t|dtƒ}|tkr5|dkr.|StSntSdS(NtstrictR(RtFalseR!(R0RR((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyR îs   cK`s|jdtjjddƒƒ}|dkr<tdƒ‚n|jdtjjddƒƒ}|dkrxtdƒ‚n|jj||ƒdS(Ntrole_idt VAULT_ROLE_IDs1Authentication method app role requires a role_idt secret_idtVAULT_SECRET_IDs3Authentication method app role requires a secret_id(RR"R#RRR&t auth_approle(R0R1R@RB((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyRDùs! ! ( t__name__t __module__R6RR;R<R=R RD(((sF/usr/lib/python2.7/site-packages/ansible/plugins/lookup/hashi_vault.pyR‡s =    t LookupModulecB`seZdd„ZRS(c K`s tstdƒ‚n|djƒ}i}g}xX|D]P}y|jddƒ\}} Wn!tk r}td|ƒ‚nX| ||s&=(     ~