summaryrefslogtreecommitdiffstats
path: root/roles/edit/tasks
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-02 13:08:03 -0400
committerSacha Chua <sacha@sachachua.com>2022-11-02 13:08:03 -0400
commitc569e02d8ab5ebcbb5a44e10c14799fa097c9bc7 (patch)
tree05528005f12160fd505696cb5d89f22d30249f32 /roles/edit/tasks
parent4696aa1fed214fe1084d7c3deecaaa289bc0a1fd (diff)
downloademacsconf-ansible-c569e02d8ab5ebcbb5a44e10c14799fa097c9bc7.tar.xz
emacsconf-ansible-c569e02d8ab5ebcbb5a44e10c14799fa097c9bc7.zip
OBS overlays, starting to get publish and edit on res
Diffstat (limited to 'roles/edit/tasks')
-rw-r--r--roles/edit/tasks/main.yaml11
-rw-r--r--roles/edit/tasks/main.yml32
2 files changed, 32 insertions, 11 deletions
diff --git a/roles/edit/tasks/main.yaml b/roles/edit/tasks/main.yaml
deleted file mode 100644
index f77535f..0000000
--- a/roles/edit/tasks/main.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-- name: Set up Emacs configuration for interactive editing
- template:
- src: emacsconf-edit.el
- dest: "{{ emacs_config_dir }}/emacsconf-edit.el"
-- name: Check if Emacs base configuration already exists
- lineinfile:
- dest: "{{ emacs_config_dir }}/init.el"
- state: present
- regexp: "emacsconf-edit"
- line: "(load-file \"emacsconf-edit.el\")"
diff --git a/roles/edit/tasks/main.yml b/roles/edit/tasks/main.yml
new file mode 100644
index 0000000..f864b23
--- /dev/null
+++ b/roles/edit/tasks/main.yml
@@ -0,0 +1,32 @@
+---
+- name: Check if Emacs is already set up for publishing
+ stat:
+ path: "{{ emacs_config_dir }}/emacsconf-config.el"
+ register: publish_config
+- name: Set up for publishing
+ include_role:
+ name: publish
+ when: not publish_config.stat.exists
+- name: Install Emacs packages
+ shell: |
+ emacs --batch --exec "(progn (require 'package)
+ (let ((packages (seq-remove #'package-installed-p '({% for package in emacsconf_edit_packages %}{{ package }} {% endfor %}))))
+ (when packages
+ (package-refresh-contents)
+ (mapc #'package-install packages))))"
+
+- name: Set up Emacs configuration for interactive editing
+ template:
+ src: emacsconf-edit.el
+ dest: "{{ emacs_config_dir }}/emacsconf-edit.el"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+- name: Check if Emacs base configuration already exists
+ lineinfile:
+ dest: "{{ emacs_config_dir }}/init.el"
+ state: present
+ regexp: "emacsconf-edit"
+ line: "(load-file \"{{ emacs_config_dir }}/emacsconf-edit.el\")"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ create: yes