Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify and make TOML config rendering more flexible #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rremizov
Copy link

I was trying to configure SNMP plugin and discovered that the current Role Vars schema doesn't support the following part:

  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysUpTime.0"
    name = "uptime"

  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysName.0"
    name = "source"

So, instead of using the template syntax to render a correct toml config we use here a custom filter which converts yaml to toml. Such an approach considerably simplifies the template and allows to create complex configurations. There are some minor downsides though:

  1. The custom filter requires toml module installed on the machine running Ansible.
  2. I had to bump the min_ansible_version to 2.0.

@rossmcdonald What do you think?

@rossmcdonald
Copy link
Owner

@rremizov I like this change a lot, as the current configuration templating was always a mess to maintain. I don't think requiring the toml package or Ansible v2 are problematic. Let me play around with this for a few days to test the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants