Compare commits

..

No commits in common. "main" and "v2.0.0" have entirely different histories.
main ... v2.0.0

9 changed files with 45 additions and 81 deletions

View file

@ -1,18 +0,0 @@
---
on: [push]
jobs:
lint:
runs-on: docker
container:
image: code.waks.be/nishiki/molecule:docker
steps:
- uses: actions/checkout@v3
- run: ansible-lint .
- run: yamllint .
molecule:
runs-on: docker
container:
image: code.waks.be/nishiki/molecule:docker
steps:
- uses: actions/checkout@v3
- run: molecule test

View file

@ -1,10 +0,0 @@
---
image: nishiki/molecule:docker
before_script:
- molecule --version
molecule:
stage: test
script:
- molecule test

View file

@ -5,10 +5,6 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased]
### Changed
- test: use personal docker registry
## v2.0.0 - 2021-08-20
### Breaked

View file

@ -1,21 +1,20 @@
# Ansible role: Postfix MTA
[![Version](https://img.shields.io/badge/latest_version-2.0.0-green.svg)](https://code.waks.be/nishiki/ansible-role-postfix_mta/releases)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://code.waks.be/nishiki/ansible-role-postfix_mta/src/branch/main/LICENSE)
[![Build](https://code.waks.be/nishiki/ansible-role-postfix_mta/actions/workflows/molecule.yml/badge.svg?branch=main)](https://code.waks.be/nishiki/ansible-role-postfix_mta/actions?workflow=molecule.yml)
[![Version](https://img.shields.io/badge/latest_version-2.0.0-green.svg)](https://git.yaegashi.fr/nishiki/ansible-role-postfix_mta/releases)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/ansible-role-postfix_mta/src/branch/master/LICENSE)
Install and configure an simple mta with postfix
## Requirements
- Ansible >= 2.9
- Debian
- Bullseye
- Bookworm
* Ansible >= 2.9
* Debian
* Buster
* Bullseye
## Role variables
- `postfix_config` - hash with config
* `postfix_config` - hash with config
```
smtpd_banner: $myhostname ESMTP $mail_name (Debian/GNU)
@ -34,13 +33,13 @@ Install and configure an simple mta with postfix
inet_protocols: all
```
- `postfix_transports` - hash with the transport configuration
* `postfix_transports` - hash with the transport configuration
```
google.com: smtp:127.0.0.1
```
- `postfix_aliases` - hash with the aliases
* `postfix_aliases` - hash with the aliases
```
root:
@ -61,18 +60,18 @@ Install and configure an simple mta with postfix
### Test with molecule and docker
- install [docker](https://docs.docker.com/engine/installation/)
- install `python3` and `python3-pip`
- install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
- run `molecule test`
* install [docker](https://docs.docker.com/engine/installation/)
* install `python3` and `python3-pip`
* install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
* run `molecule test`
### Tests with docker
- install [docker](https://docs.docker.com/engine/installation/)
- install ruby
- install bundler `gem install bundler`
- install dependencies `bundle install`
- run the tests `kitchen test`
* install [docker](https://docs.docker.com/engine/installation/)
* install ruby
* install bundler `gem install bundler`
* install dependencies `bundle install`
* run the tests `kitchen test`
## License

View file

@ -1,22 +1,22 @@
---
postfix_hostname: "{{ ansible_fqdn }}"
postfix_origin: "$myhostname"
postfix_hostname: '{{ ansible_fqdn }}'
postfix_origin: '$myhostname'
postfix_config: {}
postfix_default_config:
smtpd_banner: $myhostname ESMTP $mail_name (Debian/GNU)
biff: "no"
append_dot_mydomain: "no"
readme_directory: "no"
biff: 'no'
append_dot_mydomain: 'no'
readme_directory: 'no'
compatibility_level: 2
myhostname: "{{ ansible_fqdn }}"
myhostname: '{{ ansible_fqdn }}'
myorigin: $myhostname
mydestination: $myhostname, localhost
default_transport: smtp
mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit: "0"
recipient_delimiter: "+"
mailbox_size_limit: '0'
recipient_delimiter: '+'
inet_interfaces: localhost
inet_protocols: all
postfix_full_config: "{{ postfix_default_config | combine(postfix_config) }}"
postfix_full_config: '{{ postfix_default_config|combine(postfix_config) }}'
postfix_transports: {}
postfix_aliases: {}

View file

@ -1,11 +1,11 @@
---
- name: Reload postfix
- name: reload postfix
ansible.builtin.service:
name: postfix
state: reloaded
- name: Map transport # noqa no-changed-when
- name: map transport
ansible.builtin.command: postmap /etc/postfix/transport
- name: Map aliases # noqa no-changed-when
- name: map aliases
ansible.builtin.command: postalias /etc/postfix/aliases

View file

@ -1,18 +1,17 @@
---
galaxy_info:
role_name: postfix_mta
namespace: nishiki
author: Adrien Waksberg
company: Adrien Waksberg
description: Install and configure a simple mta with postfix
license: Apache2
min_ansible_version: "2.9"
min_ansible_version: 2.9
platforms:
- name: Debian
versions:
- buster
- bullseye
- bookworm
galaxy_tags:
- postfix

View file

@ -2,21 +2,19 @@
driver:
name: docker
platforms:
- name: debian12
image: code.waks.be/nishiki/molecule:debian12
- name: debian10
image: nishiki/debian10:molecule
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
- /sys/fs/cgroup:/sys/fs/cgroup:ro
command: /bin/systemd
capabilities:
- SYS_ADMIN
- name: debian11
image: code.waks.be/nishiki/molecule:debian11
image: nishiki/debian11:molecule
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
- /sys/fs/cgroup:/sys/fs/cgroup:ro
command: /bin/systemd
capabilities:
- SYS_ADMIN

View file

@ -1,13 +1,13 @@
---
- name: Install packages
- name: install packages
ansible.builtin.package:
name:
- postfix
- bsd-mailx
tags: postfix
- name: Copy file configuration
ansible.builtin.template:
- name: copy file configuration
template:
src: '{{ item }}.j2'
dest: '/etc/postfix/{{ item }}'
owner: root
@ -18,14 +18,14 @@
- aliases
- transport
notify:
- Reload postfix
- Map aliases
- Map transport
- reload postfix
- map aliases
- map transport
tags: postfix
- name: Enable and start service
- name: enable and start service
ansible.builtin.service:
name: postfix
enabled: true
enabled: yes
state: started
tags: postfix