---
- name: Ensure Emacs directory
  ansible.builtin.file:
    dest: '{{ HOME }}/.emacs.d'
    state: directory

- name: Link init.el
  ansible.builtin.file:
    src: '{{ PWD }}/init.el'
    dest: '{{ HOME }}/.emacs.d/init.el'
    state: link

- name: Create custom.el
  ansible.builtin.shell:
    chdir: "{{ HOME }}/.emacs.d"
    cmd: echo '' > custom.el

- name: Link irbrc (required by inf-ruby)
  ansible.builtin.file:
    src: '{{ PWD }}/irbrc'
    dest: '{{ HOME }}/.irbrc'
    state: link
...

---
- name: Install Emacs and Info Pages
  ansible.builtin.apt:
    pkg:
      - emacs
      - emacs-common-non-dfsg
    state: present
  become: yes

- name: Ensure Emacs directory
  ansible.builtin.file:
    dest: '{{ HOME }}/.emacs.d'
    state: directory

- name: Link init.el
  ansible.builtin.file:
    src: '{{ PWD }}/init.el'
    dest: '{{ HOME }}/.emacs.d/init.el'
    state: link

- name: Create custom.el
  ansible.builtin.shell:
    chdir: "{{ HOME }}/.emacs.d"
    cmd: echo '' > custom.el

- name: Link irbrc (required by inf-ruby)
  ansible.builtin.file:
    src: '{{ PWD }}/irbrc'
    dest: '{{ HOME }}/.irbrc'
    state: link
...

Install emacs and docs packages
auto.emacs: Install emacs and docs packages
