x-drum / ansible-postfix Goto Github PK
View Code? Open in Web Editor NEWThis role installs and configures Postfix.
License: GNU General Public License v2.0
This role installs and configures Postfix.
License: GNU General Public License v2.0
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.