Git Product home page Git Product logo

ansible-postfix's People

Contributors

blackstar257 avatar x-drum avatar

Stargazers

 avatar

Watchers

 avatar

ansible-postfix's Issues

Suggestion for a change

Howdy! I was looking for an Ansible role for a postfix setup I am doing, and came across yours. What caught my attention was the simplicity of your config file generation: just loop through the values, and spit it out to the config file. No need to have a bunch of "if/then" logic in the template, no need to keep up on the new/changed config options. Granted, your role's user might have to know a little more about Postfix, but there are sane defaults.

The one downside I found was that the options for postfix_main was a list, instead of a hash. That means, for me to override any option in that default list, I have to reproduce/override all of them. If you did your defaults like this:

postfix_main:
  - myhostname: "{{ ansible_hostname }}"
  - mydomain: "{{ ansible_domain }}"
  - myorigin: "{{ ansible_hostname }}"
  - inet_interfaces: localhost

local_postfix_main: {}

It would the user of the role be able to have this in their vars file:

local_postfix_main:
 - inet_interfaces: localhost, 192.168.1.25

And then in your template, you could do this:

{% for k in postfix_main | combine(local_postfix_main) %}
{{ k }} = postfix_main[k]
{% endfor %}

Or something like that, I haven't tested the syntax, and that is probably wrong. :) The combine filter is new in Ansible 2.0, so it would require that.

If you want me to do a pull request with this modification, I'd be happy to.

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.