2018-09-11 22:16:24 +03:00
|
|
|
;;; tools/ansible/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! ansible
|
2019-07-16 17:28:25 -07:00
|
|
|
:commands ansible-auto-decrypt-encrypt
|
2018-09-11 22:16:24 +03:00
|
|
|
:init
|
2019-07-16 17:28:25 -07:00
|
|
|
(put 'ansible-vault-password-file 'safe-local-variable #'stringp)
|
2018-09-11 22:16:24 +03:00
|
|
|
:config
|
2019-07-16 17:28:25 -07:00
|
|
|
(setq ansible-section-face 'font-lock-variable-name-face
|
|
|
|
ansible-task-label-face 'font-lock-doc-face)
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! :completion company)
|
2021-01-04 18:33:45 +01:00
|
|
|
(set-company-backend! 'ansible 'company-ansible))
|
2019-07-16 17:28:25 -07:00
|
|
|
(map! :map ansible-key-map
|
2018-09-11 22:16:24 +03:00
|
|
|
:localleader
|
2019-07-16 17:28:25 -07:00
|
|
|
:desc "Decrypt buffer" "d" #'ansible-decrypt-buffer
|
|
|
|
:desc "Encrypt buffer" "e" #'ansible-encrypt-buffer
|
2018-12-23 23:54:27 -05:00
|
|
|
:desc "Look up in Ansible docs" "h" #'ansible-doc))
|
2018-09-11 22:16:24 +03:00
|
|
|
|
2020-07-23 01:04:04 -04:00
|
|
|
|
2018-09-11 22:16:24 +03:00
|
|
|
(after! ansible-doc
|
|
|
|
(set-evil-initial-state! '(ansible-doc-module-mode) 'emacs))
|
|
|
|
|
2020-07-23 01:04:04 -04:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! jinja2-mode
|
2024-08-25 16:13:09 -04:00
|
|
|
:mode "\\.j2\\'"
|
2020-07-16 17:38:43 -04:00
|
|
|
:config
|
|
|
|
;; The default behavior is to reindent the whole buffer on save. This is
|
|
|
|
;; disruptive and imposing. There are indentation commands available; the user
|
|
|
|
;; can decide when they want their code reindented.
|
2020-07-24 01:59:00 -04:00
|
|
|
(setq jinja2-enable-indent-on-save nil))
|
2018-09-11 22:16:24 +03:00
|
|
|
|
2020-07-23 01:04:04 -04:00
|
|
|
|
2018-09-11 22:16:24 +03:00
|
|
|
(def-project-mode! +ansible-yaml-mode
|
2019-07-21 14:49:09 +02:00
|
|
|
:modes '(yaml-mode)
|
2024-07-11 20:18:35 +02:00
|
|
|
:add-hooks '(ansible-mode ansible-auto-decrypt-encrypt ansible-doc-mode)
|
2022-10-28 17:47:15 -07:00
|
|
|
:files (or "roles/" "tasks/main.yml" "tasks/main.yaml"))
|