Created
January 26, 2022 03:33
-
-
Save DavesCodeMusings/fca7fde0f3ed31e81a67b2fe7bf4e7bf to your computer and use it in GitHub Desktop.
Ansible playbook to create mailboxes for users on Raspberry Pi OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Configure mailboxes for users | |
| hosts: localhost | |
| connection: local | |
| become: true | |
| vars: | |
| accounts: | |
| - pi | |
| tasks: | |
| - name: Creating mailbox | |
| ansible.builtin.file: | |
| path: "/var/mail/{{ item }}" | |
| owner: "{{ item }}" | |
| group: mail | |
| state: touch | |
| mode: "0660" | |
| with_items: "{{ accounts }}" | |
| - name: Adding user to mail group | |
| user: | |
| name: "{{ item }}" | |
| groups: mail | |
| append: yes | |
| with_items: "{{ accounts }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment