2019-10-03 10:50:19 +00:00
|
|
|
---
|
2020-07-11 16:11:19 +00:00
|
|
|
- name: Detect Emacs binary
|
2020-07-11 16:04:46 +00:00
|
|
|
stat:
|
|
|
|
path: "{{ prefix }}/bin/emacs"
|
|
|
|
vars:
|
|
|
|
prefix: "{{ '/usr' if ansible_system == 'Linux' else '/usr/pkg' if ansible_system == 'NetBSD' else '/usr/local' }}"
|
|
|
|
register: emacs_binary
|
2019-10-03 14:24:33 +00:00
|
|
|
- name: Clone Emacs settings
|
2019-10-03 10:50:19 +00:00
|
|
|
git:
|
2020-01-10 15:39:47 +00:00
|
|
|
repo: https://code.acperkins.com/acp/emacs.d.git
|
2019-10-03 10:50:19 +00:00
|
|
|
dest: "{{ ansible_env.HOME }}/.emacs.d"
|
2020-02-28 14:20:29 +00:00
|
|
|
- name: Create Emacs user service (Linux)
|
2020-07-11 16:22:27 +00:00
|
|
|
template:
|
2020-03-08 22:09:14 +00:00
|
|
|
src: emacs.service
|
2020-02-28 14:20:29 +00:00
|
|
|
dest: "{{ ansible_env.HOME }}/.config/systemd/user/emacs.service"
|
2020-07-11 16:22:27 +00:00
|
|
|
vars:
|
|
|
|
prefix: "{{ '/usr' if ansible_system == 'Linux' else '/usr/pkg' if ansible_system == 'NetBSD' else '/usr/local' }}"
|
2020-07-11 16:11:19 +00:00
|
|
|
when: ansible_system == 'Linux' and emacs_binary.stat.exists == True
|
2020-02-28 14:20:29 +00:00
|
|
|
- name: Add Emacs server to autostart (FreeBSD)
|
|
|
|
copy:
|
|
|
|
src: '{{ ansible_env.HOME }}/.emacs.d/emacs-server.desktop'
|
|
|
|
dest: '{{ ansible_env.HOME }}/.config/autostart'
|
|
|
|
remote_src: yes
|
2020-07-11 16:11:19 +00:00
|
|
|
when: ansible_system == 'FreeBSD' and emacs_binary.stat.exists == True
|
2020-02-28 14:20:29 +00:00
|
|
|
- name: Start Emacs user service
|
|
|
|
systemd:
|
|
|
|
name: emacs.service
|
|
|
|
scope: user
|
|
|
|
daemon_reload: yes
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
2020-07-11 16:11:19 +00:00
|
|
|
when: ansible_system == 'Linux' and emacs_binary.stat.exists == True
|
2020-02-28 14:20:29 +00:00
|
|
|
- name: Create Emacs client launcher
|
|
|
|
copy:
|
|
|
|
src: "{{ ansible_env.HOME }}/.emacs.d/emacs-client.desktop"
|
|
|
|
dest: "{{ ansible_env.HOME }}/.local/share/applications/emacs.desktop"
|
|
|
|
remote_src: yes
|
2020-07-11 16:11:19 +00:00
|
|
|
when: emacs_binary.stat.exists == True
|