Code Monkey home page Code Monkey logo

ybr.github.io's People

Contributors

ybr avatar

Watchers

 avatar  avatar

ybr.github.io's Issues

ansible how to have monitor many JVM on a same host

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

provide programmatically a dictionnary for docker_container.etc_hosts

- 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 }}

ansible, slack message with role name and role inheritance

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 }}"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.