mirror of
https://github.com/fscotto/infra.git
synced 2026-11-26 13:49:52 +00:00
Seed a Thunderbird profile on ikaros and nymph with the iCloud account already declared: IMAP imap.mail.me.com:993 over SSL/TLS, SMTP smtp.mail.me.com:587 over STARTTLS, identity and folder mapping, one CalDAV calendar and one CardDAV address book. Account defaults are rendered into a managed user.js because Thunderbird rewrites prefs.js on exit, while user.js is re-applied at every start. profiles.ini is seeded only when absent so a profile list Thunderbird already owns is never replaced. The address comes from vault_icloud_email and the display name from vault_personal_full_name. The app-specific password is deliberately not stored: Thunderbird requests it on first use and keeps it in its own credential store. Validated by rendering the templates and running Thunderbird 158 headless against a sandbox profile: the account was accepted, Local Folders was created by Thunderbird itself, the CalDAV calendar registered as default and the CardDAV directory instantiated its abook-icloud.sqlite.
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
---
|
|
- name: Require the iCloud address for the managed Thunderbird profile
|
|
tags: [thunderbird]
|
|
ansible.builtin.assert:
|
|
that:
|
|
- vault_icloud_email is defined
|
|
- vault_icloud_email | length > 0
|
|
- vault_icloud_email != 'REPLACE_ME'
|
|
- vault_icloud_email is match('^[^@\s]+@[^@\s]+$')
|
|
fail_msg: >-
|
|
vault_icloud_email must hold the iCloud mail address before the
|
|
Thunderbird profile can be provisioned.
|
|
quiet: true
|
|
|
|
- name: Create the Thunderbird configuration directory
|
|
tags: [thunderbird]
|
|
ansible.builtin.file:
|
|
path: "{{ user_home }}/.thunderbird"
|
|
state: directory
|
|
owner: "{{ username }}"
|
|
group: "{{ user_group }}"
|
|
mode: "0700"
|
|
|
|
- name: Create the managed Thunderbird profile directory
|
|
tags: [thunderbird]
|
|
ansible.builtin.file:
|
|
path: "{{ user_home }}/.thunderbird/{{ thunderbird_profile_dir }}"
|
|
state: directory
|
|
owner: "{{ username }}"
|
|
group: "{{ user_group }}"
|
|
mode: "0700"
|
|
|
|
- name: Seed the Thunderbird profile registry when absent
|
|
tags: [thunderbird]
|
|
ansible.builtin.template:
|
|
src: thunderbird/profiles.ini.j2
|
|
dest: "{{ user_home }}/.thunderbird/profiles.ini"
|
|
owner: "{{ username }}"
|
|
group: "{{ user_group }}"
|
|
mode: "0600"
|
|
# Never rewrite a profile list Thunderbird has already taken over.
|
|
force: false
|
|
|
|
- name: Render the managed Thunderbird account defaults
|
|
tags: [thunderbird]
|
|
ansible.builtin.template:
|
|
src: thunderbird/user.js.j2
|
|
dest: "{{ user_home }}/.thunderbird/{{ thunderbird_profile_dir }}/user.js"
|
|
owner: "{{ username }}"
|
|
group: "{{ user_group }}"
|
|
mode: "0600"
|
|
no_log: true
|