Created
February 9, 2017 22:53
-
-
Save mohclips/84513f79cf85a01542a34d5ddf08df37 to your computer and use it in GitHub Desktop.
fun lineinfile to update the beats configs with the elastic search hosts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: "Update configs" | |
lineinfile: | |
dest: "/etc/{{ item }}/{{ item }}.yml" | |
regexp: '^ hosts:' | |
line: ' hosts: [{% set comma = joiner(",") %}{% for es in elastic_search_hosts %}{{ comma() }}"{{ es }}"{% endfor %} ]' | |
with_items: | |
- filebeat | |
- packetbeat | |
- metricbeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment