??????????????
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@`svddlmZmZmZeZidd6dgd6dd6ZdZd ZyEdd l Z dd l m Z d e j j jfd „ƒYZeZWnek rªeZnXddlmZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd d„Zd„Zd„Z d„Z!dd!d„ƒYZ"de#fd„ƒYZ$d„Z%d„Z&e'd krre&ƒnd S("i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust communityt supported_bysy module: consul short_description: "Add, modify & delete services within a consul cluster." description: - Registers services and checks for an agent with a consul cluster. A service is some process running on the agent node that should be advertised by consul's discovery mechanism. It may optionally supply a check definition, a periodic service test to notify the consul cluster of service's health. - "Checks may also be registered per node e.g. disk usage, or cpu usage and notify the health of the entire node to the cluster. Service level checks do not require a check name or id as these are derived by Consul from the Service name and id respectively by appending 'service:' Node level checks require a I(check_name) and optionally a I(check_id)." - Currently, there is no complete way to retrieve the script, interval or ttl metadata for a registered check. Without this metadata it is not possible to tell if the data supplied with ansible represents a change to a check. As a result this does not attempt to determine changes and will always report a changed occurred. An API method is planned to supply this metadata so at that stage change management will be added. - "See U(http://consul.io) for more details." requirements: - python-consul - requests version_added: "2.0" author: "Steve Gargan (@sgargan)" options: state: description: - register or deregister the consul service, defaults to present default: present choices: ['present', 'absent'] service_name: type: str description: - Unique name for the service on a node, must be unique per node, required if registering a service. May be omitted if registering a node level check service_id: type: str description: - the ID for the service, must be unique per node. If I(state=absent), defaults to the service name if supplied. host: type: str description: - host of the consul agent defaults to localhost default: localhost port: type: int description: - the port on which the consul agent is running default: 8500 scheme: type: str description: - the protocol scheme on which the consul agent is running default: http version_added: "2.1" validate_certs: description: - whether to verify the TLS certificate of the consul agent type: bool default: 'yes' version_added: "2.1" notes: type: str description: - Notes to attach to check when registering it. service_port: type: int description: - the port on which the service is listening. Can optionally be supplied for registration of a service, i.e. if I(service_name) or I(service_id) is set service_address: type: str description: - the address to advertise that the service will be listening on. This value will be passed as the I(address) parameter to Consul's U(/v1/agent/service/register) API method, so refer to the Consul API documentation for further details. version_added: "2.1" tags: type: list description: - tags that will be attached to the service registration. script: type: str description: - the script/command that will be run periodically to check the health of the service. Scripts require I(interval) and vice versa. interval: type: str description: - the interval at which the service check will be run. This is a number with a s or m suffix to signify the units of seconds or minutes e.g C(15s) or C(1m). If no suffix is supplied, m will be used by default e.g. C(1) will be C(1m). Required if the I(script) parameter is specified. check_id: type: str description: - an ID for the service check. If I(state=absent), defaults to I(check_name). Ignored if part of a service definition. check_name: type: str description: - a name for the service check. Required if standalone, ignored if part of service definition. ttl: type: str description: - checks can be registered with a ttl instead of a I(script) and I(interval) this means that the service will check in with the agent before the ttl expires. If it doesn't the check will be considered failed. Required if registering a check and the script an interval are missing Similar to the interval this is a number with a s or m suffix to signify the units of seconds or minutes e.g C(15s) or C(1m). If no suffix is supplied, C(m) will be used by default e.g. C(1) will be C(1m) http: type: str description: - checks can be registered with an HTTP endpoint. This means that consul will check that the http endpoint returns a successful HTTP status. I(interval) must also be provided with this option. version_added: "2.0" timeout: type: str description: - A custom HTTP check timeout. The consul default is 10 seconds. Similar to the interval this is a number with a C(s) or C(m) suffix to signify the units of seconds or minutes, e.g. C(15s) or C(1m). version_added: "2.0" token: type: str description: - the token key identifying an ACL rule set. May be required to register services. s - name: register nginx service with the local consul agent consul: service_name: nginx service_port: 80 - name: register nginx service with curl check consul: service_name: nginx service_port: 80 script: curl http://localhost interval: 60s - name: register nginx with an http check consul: service_name: nginx service_port: 80 interval: 60s http: http://localhost:80/status - name: register external service nginx available at 10.1.5.23 consul: service_name: nginx service_port: 80 service_address: 10.1.5.23 - name: register nginx with some service tags consul: service_name: nginx service_port: 80 tags: - prod - webservers - name: remove nginx service consul: service_name: nginx state: absent - name: register celery worker service consul: service_name: celery-worker tags: - prod - worker - name: create a node level check to test disk usage consul: check_name: Disk usage check_id: disk_usage script: /opt/disk_usage.py interval: 5m - name: register an http check against a service that's already registered consul: check_name: nginx-check2 check_id: nginx-check2 service_id: nginx interval: 60s http: http://localhost:80/morestatus N(tConnectionErrortPatchedConsulAgentServicecB`seZdd„ZRS(cC`sEi}|r||d adds a service or a check depending on supplied configurationtmsgs2a name and port are required to register a serviceN(t parse_checkt parse_servicet fail_jsont add_checkt add_service(Rtchecktservice((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyRós  cC`sŽ|jjdƒp!|jjdƒ}|jjdƒpE|jjdƒ}|pQ|sg|jddƒn|r}t||ƒn t||ƒdS(s removes a service or a check Rt service_nametcheck_idt check_nameR!saservices and checks are removed by id or name. please supply a service id/name or a check id/nameN(R RR$tremove_servicet remove_check(RRR*((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyRs$$ cC`sœ|j r'|j r'|jddƒnt|ƒ}|j|ƒ|jdtd|jd|jd|jd|j d|j d |j d |j d |jƒ d S( sì registers a check with the given agent. currently there is no way retrieve the full metadata of an existing check through the consul api. Without this we can't compare to the supplied check and so we must assume a change. R!sNa check name is required for a node level check, one not attached to a servicetchangedR*R+tscripttintervaltttlR ttimeoutRN( tnameRR$tget_consul_apitregistert exit_jsontTrueR*R/R0R1R R2(RR't consul_api((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR%s         cC`sgt|ƒ}||jjƒkrM|jjj|ƒ|jdtd|ƒn|jdtd|ƒdS(s removes a check using its id R.tidN(R4R tchecksR'RR6R7tFalse(RR*R8((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR-%s  cC`sÛ|}t}t|ƒ}t||jƒ}|jƒsJ| sJ||k r|j|ƒt||jƒ}|r|}t}qn|jd|d|jd|jd|j dg|j D]}|j ƒ^qµd|j ƒdS(s, registers a service with the current agent R.RR)t service_portR:ttagsN( R;R4tget_service_by_id_or_nameR9t has_checksR5R7R6R3tportR:tto_dictR=(RR(tresultR.R8texistingt registeredR'((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR&0s        "cC`syt|ƒ}t||ƒ}|r_|jjj|d|jjdƒƒ|jdtd|ƒn|jdt d|ƒdS(s@ deregister a service from the given agent using its service id R R.R9N( R4R>R R(RR RR6R7R;(RRR8R(((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR,Ks  %c C`s|tjd|jjdƒd|jjdƒd|jjdƒd|jjdƒd|jjdƒƒ}t|ƒ|j_|S(NthostR@tschemetverifytvalidate_certsR (RtConsulR RR R R((RR t consulClient((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR4VscC`sWxP|jjƒjƒD]9\}}|d|ksB|d|krtd|ƒSqWdS(s@ iterate the registered services and find one with the given id tIDtServicetloadedN(R tservicestitemst ConsulService(R8tservice_id_or_nameR3R(((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR>`s" cC`sctg|jjdƒ|jjdƒ|jjdƒfD]}|r7|^q7ƒdkrk|jddƒn|jjdƒs³|jjdƒs³|jjdƒs³|jjdƒr_t|jjdƒ|jjdƒ|jjd ƒ|jjd ƒ|jjdƒ|jjd ƒ|jjdƒ|jjd ƒ|jjdƒ|jjd ƒ|jjdƒƒ SdS(NR/R1R iR!sYchecks are either script, http or ttl driven, supplying more than one does not make senseR*R+t check_nodet check_hostR0tnotesR2R(tlenR RR$t ConsulCheck(Rtp((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR"gs X  HcC`s|jjdƒrdt|jjdƒ|jjdƒ|jjdƒ|jjdƒ|jjdƒƒS|jjdƒs‰|jddƒndS(NR)Rtservice_addressR<R=R!s0service_name is required to configure a service.(R RRPR$(R((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR#}sRPcB`sbeZd d d dd d d„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( iÿÿÿÿcC`s‡||_|_|r"||_n||_||_||_g|_|rƒ|d|_|d|_|d|_|d|_ndS(NRKRLtPorttTags(R9R3taddressR@R=R:(RRR3R[R@R=RM((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyt__init__Œs        c C`sƒi}|jr|j|dìss{0}s(tanytformat(RR3Rstduration_units((RssE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyRgés c C`s>|jjj|jd|jd|jd|jd|jƒdS(NR*RRTR'(R R'R5R3R*RRT(RR8((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyR5ðs' cC`sjt||jƒoi|j|jkoi|j|jkoi|j|jkoi|j|jkoi|j|jkS(N(R_R`R*RR3R/R0(RRa((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyRbõs cC`s|j|ƒ S(N(Rb(RRa((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyRcýscC`sÆi}|j|dddƒ|j|dddƒ|j|dƒ|j|dƒ|j|dƒ|j|d ƒ|j|d ƒ|j|d ƒ|j|d ƒ|j|d ƒ|j|dƒ|S(NR9tattrR*R3R+R/RfRTRER0R1R R2R(t_add(RRd((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyRAscC`sDy,|dkr|}nt||ƒ||R"R#RPtobjectRVR|RŠR(((sE/usr/lib/python2.7/site-packages/ansible/modules/clustering/consul.pyts>   Š>          ?O  '