I’m instaling collectd service using ansible version 2.4 and making some changes into the colectd config and that’s working fine.
In my playbook i’m using lineinfile
module to make the chnages in the collectd confg file using the regex , here i have two lineinfile
chnages one is to chnage
the default Hostname from the config file using ansible_hostname
variable while in another line i have some Prefix’s which i’m changing and that the Key point for my playbook…
For clarification belwo the line where i need the playbook to be opting the values dynamically
Example:
a) this is what is value looks like
Prefix “collectd..<Changable_StateName>.<Changable_location>”
b) this is what i’m appending values manually in my play as of now …
Prefix "collectd.OpenDJ.EMEA.sophia.
My Invetory looks like as follows( this is based on host:var and using private keys over)