Compare commits
No commits in common. "main" and "v2.0.0" have entirely different histories.
9 changed files with 45 additions and 81 deletions
|
@ -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
|
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
image: nishiki/molecule:docker
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- molecule --version
|
|
||||||
|
|
||||||
molecule:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- molecule test
|
|
|
@ -5,10 +5,6 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- test: use personal docker registry
|
|
||||||
|
|
||||||
## v2.0.0 - 2021-08-20
|
## v2.0.0 - 2021-08-20
|
||||||
|
|
||||||
### Breaked
|
### Breaked
|
||||||
|
|
37
README.md
37
README.md
|
@ -1,21 +1,20 @@
|
||||||
# Ansible role: Postfix MTA
|
# 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)
|
[![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://code.waks.be/nishiki/ansible-role-postfix_mta/src/branch/main/LICENSE)
|
[![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)
|
||||||
[![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)
|
|
||||||
|
|
||||||
Install and configure an simple mta with postfix
|
Install and configure an simple mta with postfix
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Ansible >= 2.9
|
* Ansible >= 2.9
|
||||||
- Debian
|
* Debian
|
||||||
- Bullseye
|
* Buster
|
||||||
- Bookworm
|
* Bullseye
|
||||||
|
|
||||||
## Role variables
|
## Role variables
|
||||||
|
|
||||||
- `postfix_config` - hash with config
|
* `postfix_config` - hash with config
|
||||||
|
|
||||||
```
|
```
|
||||||
smtpd_banner: $myhostname ESMTP $mail_name (Debian/GNU)
|
smtpd_banner: $myhostname ESMTP $mail_name (Debian/GNU)
|
||||||
|
@ -34,13 +33,13 @@ Install and configure an simple mta with postfix
|
||||||
inet_protocols: all
|
inet_protocols: all
|
||||||
```
|
```
|
||||||
|
|
||||||
- `postfix_transports` - hash with the transport configuration
|
* `postfix_transports` - hash with the transport configuration
|
||||||
|
|
||||||
```
|
```
|
||||||
google.com: smtp:127.0.0.1
|
google.com: smtp:127.0.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
- `postfix_aliases` - hash with the aliases
|
* `postfix_aliases` - hash with the aliases
|
||||||
|
|
||||||
```
|
```
|
||||||
root:
|
root:
|
||||||
|
@ -61,18 +60,18 @@ Install and configure an simple mta with postfix
|
||||||
|
|
||||||
### Test with molecule and docker
|
### Test with molecule and docker
|
||||||
|
|
||||||
- install [docker](https://docs.docker.com/engine/installation/)
|
* install [docker](https://docs.docker.com/engine/installation/)
|
||||||
- install `python3` and `python3-pip`
|
* install `python3` and `python3-pip`
|
||||||
- install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
|
* install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
|
||||||
- run `molecule test`
|
* run `molecule test`
|
||||||
|
|
||||||
### Tests with docker
|
### Tests with docker
|
||||||
|
|
||||||
- install [docker](https://docs.docker.com/engine/installation/)
|
* install [docker](https://docs.docker.com/engine/installation/)
|
||||||
- install ruby
|
* install ruby
|
||||||
- install bundler `gem install bundler`
|
* install bundler `gem install bundler`
|
||||||
- install dependencies `bundle install`
|
* install dependencies `bundle install`
|
||||||
- run the tests `kitchen test`
|
* run the tests `kitchen test`
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
---
|
---
|
||||||
postfix_hostname: "{{ ansible_fqdn }}"
|
postfix_hostname: '{{ ansible_fqdn }}'
|
||||||
postfix_origin: "$myhostname"
|
postfix_origin: '$myhostname'
|
||||||
postfix_config: {}
|
postfix_config: {}
|
||||||
postfix_default_config:
|
postfix_default_config:
|
||||||
smtpd_banner: $myhostname ESMTP $mail_name (Debian/GNU)
|
smtpd_banner: $myhostname ESMTP $mail_name (Debian/GNU)
|
||||||
biff: "no"
|
biff: 'no'
|
||||||
append_dot_mydomain: "no"
|
append_dot_mydomain: 'no'
|
||||||
readme_directory: "no"
|
readme_directory: 'no'
|
||||||
compatibility_level: 2
|
compatibility_level: 2
|
||||||
myhostname: "{{ ansible_fqdn }}"
|
myhostname: '{{ ansible_fqdn }}'
|
||||||
myorigin: $myhostname
|
myorigin: $myhostname
|
||||||
mydestination: $myhostname, localhost
|
mydestination: $myhostname, localhost
|
||||||
default_transport: smtp
|
default_transport: smtp
|
||||||
mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
|
mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
|
||||||
mailbox_size_limit: "0"
|
mailbox_size_limit: '0'
|
||||||
recipient_delimiter: "+"
|
recipient_delimiter: '+'
|
||||||
inet_interfaces: localhost
|
inet_interfaces: localhost
|
||||||
inet_protocols: all
|
inet_protocols: all
|
||||||
postfix_full_config: "{{ postfix_default_config | combine(postfix_config) }}"
|
postfix_full_config: '{{ postfix_default_config|combine(postfix_config) }}'
|
||||||
postfix_transports: {}
|
postfix_transports: {}
|
||||||
postfix_aliases: {}
|
postfix_aliases: {}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
---
|
---
|
||||||
- name: Reload postfix
|
- name: reload postfix
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: postfix
|
name: postfix
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
- name: Map transport # noqa no-changed-when
|
- name: map transport
|
||||||
ansible.builtin.command: postmap /etc/postfix/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
|
ansible.builtin.command: postalias /etc/postfix/aliases
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
---
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
role_name: postfix_mta
|
role_name: postfix_mta
|
||||||
namespace: nishiki
|
|
||||||
author: Adrien Waksberg
|
author: Adrien Waksberg
|
||||||
company: Adrien Waksberg
|
company: Adrien Waksberg
|
||||||
description: Install and configure a simple mta with postfix
|
description: Install and configure a simple mta with postfix
|
||||||
license: Apache2
|
license: Apache2
|
||||||
min_ansible_version: "2.9"
|
min_ansible_version: 2.9
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
|
- buster
|
||||||
- bullseye
|
- bullseye
|
||||||
- bookworm
|
|
||||||
|
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- postfix
|
- postfix
|
||||||
|
|
|
@ -2,21 +2,19 @@
|
||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
platforms:
|
platforms:
|
||||||
- name: debian12
|
- name: debian10
|
||||||
image: code.waks.be/nishiki/molecule:debian12
|
image: nishiki/debian10:molecule
|
||||||
privileged: true
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
cgroupns_mode: host
|
|
||||||
command: /bin/systemd
|
command: /bin/systemd
|
||||||
capabilities:
|
capabilities:
|
||||||
- SYS_ADMIN
|
- SYS_ADMIN
|
||||||
- name: debian11
|
- name: debian11
|
||||||
image: code.waks.be/nishiki/molecule:debian11
|
image: nishiki/debian11:molecule
|
||||||
privileged: true
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
cgroupns_mode: host
|
|
||||||
command: /bin/systemd
|
command: /bin/systemd
|
||||||
capabilities:
|
capabilities:
|
||||||
- SYS_ADMIN
|
- SYS_ADMIN
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
---
|
---
|
||||||
- name: Install packages
|
- name: install packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- postfix
|
- postfix
|
||||||
- bsd-mailx
|
- bsd-mailx
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|
||||||
- name: Copy file configuration
|
- name: copy file configuration
|
||||||
ansible.builtin.template:
|
template:
|
||||||
src: '{{ item }}.j2'
|
src: '{{ item }}.j2'
|
||||||
dest: '/etc/postfix/{{ item }}'
|
dest: '/etc/postfix/{{ item }}'
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -18,14 +18,14 @@
|
||||||
- aliases
|
- aliases
|
||||||
- transport
|
- transport
|
||||||
notify:
|
notify:
|
||||||
- Reload postfix
|
- reload postfix
|
||||||
- Map aliases
|
- map aliases
|
||||||
- Map transport
|
- map transport
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|
||||||
- name: Enable and start service
|
- name: enable and start service
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: postfix
|
name: postfix
|
||||||
enabled: true
|
enabled: yes
|
||||||
state: started
|
state: started
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|
Loading…
Reference in a new issue