ybr / ybr.github.io Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I had an unexpected handler execution sequence not consistent with the notify order, it happens it is not related to the notify ordering but the handler declaration order which one can't manage properly with imports, at least I can't find how. One must need inheritance of roles to achieve proper ordering of handlers.
https://raymii.org/s/tutorials/Ansible_-_Only-do-something-if-another-action-changed.html
Create fragments with template module then assmble them with assemble module
In datadog agent configuration folder
/etc/dd-agent/conf.d/jmx/fragment.0.header.yaml
/etc/dd-agent/conf.d/jmx/fragment.roleApp1.yaml
/etc/dd-agent/conf.d/jmx/fragment.roleApp2.yaml
assemble to
/etc/dd-agent/conf.d/jmx.yaml
RoleApp1
- name: datadog
template: src=datadog-jmx.j2.yaml dest=/etc/dd-agent/conf.d/jmx/fragment.roleApp1.yaml
notify: datadog assemble jmx
datadog handlers
- name: datadog prepare assemble jmx
template:
src: datadog-jmx.j2.yaml
dest: /etc/dd-agent/conf.d/jmx/fragment.0.header.yaml # Files are assembled in string sorting order
listen: datadog assemble jmx
- name: datadog do assemble jmx
assemble:
src: /etc/dd-agent/conf.d/jmx
dest: /etc/dd-agent/conf.d/jmx.yaml
regexp: ".*\\.yaml"
delimiter: '### START FRAGMENT ###'
backup: yes
listen: datadog assemble jmx
- name : start
docker_container:
name: ckh
image: registry.mycompany.com:5000/ica/clickhouse:{{ TAG }}
state: started
ports:
- "8123:8123"
- "9000:9000"
- "9009:9009"
volumes:
- /opt/clickhouse-server/clickhouse.xml:/etc/clickhouse-server/conf.d/config.xml
- /data/clickhouse:/var/lib/clickhouse
# volumes_from:
# - ckh_data
etc_hosts: |
{% set dict = {} -%}
{%- for host in groups["clickhouse"] -%}
{% set ignored = dict.update({ host : host }) %}
{%- endfor %}
{{ dict }}
One can write the slack task in a defaults role inherited from other roles (such as zookeeper, ...)
Once started zookeeper cluster we want to send a slack message so we notify the slack handler but we have to pass it some role name in order to know what we deployed on which hosts.
Pass a parameter to your role that has the name like:
- hosts: zookeeper
roles:
- { role: zookeeper, slack_role: zookeeper }
then in the slack handler:
msg: "I deployed {{ slack_role }} on {{ ansible_play_hosts | to_json }}"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.