mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2025-01-18 08:06:16 +01:00
Seems ansible-lint thinks a task calling the unqualified user module is "not valid under any of the given schemas (schema[tasks])".
26 lines
927 B
YAML
26 lines
927 B
YAML
- name: Install postfix
|
|
pacman: name=postfix state=present
|
|
|
|
- name: Install template configs
|
|
template: src={{ item.file }}.j2 dest=/etc/postfix/{{ item.file }} owner=root group={{ item.group }} mode={{ item.mode }}
|
|
with_items:
|
|
- {file: main.cf, group: root, mode: 644}
|
|
- {file: relay_passwords, group: postfix, mode: 640}
|
|
notify:
|
|
- Reload postfix
|
|
|
|
- name: Create user account on mail to relay with
|
|
delegate_to: mail.archlinux.org
|
|
ansible.builtin.user:
|
|
name: "{{ inventory_hostname_short }}"
|
|
comment: "SMTP Relay Account for {{ inventory_hostname }}"
|
|
group: nobody
|
|
password: "{{ postfix_relay_password | password_hash('sha512') }}"
|
|
shell: /sbin/nologin
|
|
update_password: always
|
|
home: /home/"{{ inventory_hostname }}" # Set home directory so shadow.service does not fail
|
|
create_home: true
|
|
|
|
- name: Start and enable postfix
|
|
service: name=postfix enabled=yes state=started
|