??????????????
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ð d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l m Z d d
l
m Z m Z d d l m Z d d l m Z y d d l Z e Z Wn e k
rÕ Z e Z n Xd e f d „ ƒ YZ d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysö
lookup: consul_kv
version_added: "1.9"
short_description: Fetch metadata from a Consul key value store.
description:
- Lookup metadata for a playbook from the key value store in a Consul cluster.
Values can be easily set in the kv store with simple rest commands
- C(curl -X PUT -d 'some-value' http://localhost:8500/v1/kv/ansible/somedata)
requirements:
- 'python-consul python library U(https://python-consul.readthedocs.io/en/latest/#installation)'
options:
_raw:
description: List of key(s) to retrieve.
type: list
required: True
recurse:
type: boolean
description: If true, will retrieve all the values that have the given key as prefix.
default: False
index:
description:
- If the key has a value with the specified index then this is returned allowing access to historical values.
datacenter:
description:
- Retrieve the key from a consul datatacenter other than the default for the consul host.
version_added: "2.9"
token:
description: The acl token to allow access to restricted values.
host:
default: localhost
description:
- The target to connect to, must be a resolvable address.
Will be determined from C(ANSIBLE_CONSUL_URL) if that is set.
- "C(ANSIBLE_CONSUL_URL) should look like this: C(https://my.consul.server:8500)"
env:
- name: ANSIBLE_CONSUL_URL
ini:
- section: lookup_consul
key: host
version_added: "2.8"
port:
description:
- The port of the target host to connect to.
- If you use C(ANSIBLE_CONSUL_URL) this value will be used from there.
default: 8500
scheme:
default: http
description:
- Whether to use http or https.
- If you use C(ANSIBLE_CONSUL_URL) this value will be used from there.
version_added: "2.8"
validate_certs:
default: True
description: Whether to verify the ssl connection or not.
env:
- name: ANSIBLE_CONSUL_VALIDATE_CERTS
ini:
- section: lookup_consul
key: validate_certs
version_added: "2.8"
client_cert:
description: The client cert to verify the ssl connection.
env:
- name: ANSIBLE_CONSUL_CLIENT_CERT
ini:
- section: lookup_consul
key: client_cert
version_added: "2.8"
sæ
- debug:
msg: 'key contains {{item}}'
with_consul_kv:
- 'key/to/retrieve'
- name: Parameters can be provided after the key be more specific about what to retrieve
debug:
msg: 'key contains {{item}}'
with_consul_kv:
- 'key/to recurse=true token=E6C060A9-26FB-407A-B83E-12DDAFCB4D98'
- name: retrieving a KV from a remote cluster on non default port
debug:
msg: "{{ lookup('consul_kv', 'my/key', host='10.10.10.10', port='2000') }}"
s=
_raw:
description:
- Value(s) stored in consul.
N( t urlparse( t AnsibleErrort AnsibleAssertionError( t
LookupBase( t to_textt LookupModulec B` s e Z d d „ Z d „ Z RS( c K` s% t s t d ƒ ‚ n g } yÚxÓ| D]Ë} | j | ƒ } yv t j d } t j d pZ t } t j d pm d } t | ƒ }
t j d |
j
d |
j d |
j d | d | ƒ } Wn• t
k
rG| j d d
ƒ } | j d d ƒ }
| j d d ƒ } | j d
t ƒ } | j d d ƒ } t j d |
d | d | d | d | ƒ } n X| j j | d d | d d | d d | d d | d ƒ} | d r% t | d t ƒ rÒxG | d D] } | j t | d ƒ ƒ q®Wqð| j t | d d ƒ ƒ q% q% WWn) t k
r } t d | | f ƒ ‚ n X| S( Nsp python-consul is required for consul_kv lookup. see http://python-consul.readthedocs.org/en/latest/#installationt ANSIBLE_CONSUL_URLt ANSIBLE_CONSUL_VALIDATE_CERTSt ANSIBLE_CONSUL_CLIENT_CERTt hostt portt schemet verifyt certt 8500t localhostt httpt validate_certst client_certt keyt tokent indext recurset dct
datacenteri t Values- Error locating '%s' in kv store. Error was %s( t
HAS_CONSULR t parse_paramst ost environt Truet NoneR t consult Consult hostnameR R t KeyErrort gett kvt
isinstancet listt appendR t Exception( t selft termst variablest kwargst valuest termt paramst urlR R t ut
consul_apiR R R t resultst rt e( ( sD /usr/lib/python2.7/site-packages/ansible/plugins/lookup/consul_kv.pyt runy sH
*
!
&c C` sÚ | j d ƒ } i | d d 6d d 6t d 6d d 6d d 6} yr xk | d D]_ } | rJ t | ƒ d k rJ | j d ƒ \ } } | | k rœ t d
| ƒ ‚ n | | |