Function: ansible-vault-string

ansible-vault-string is a natively compiled function defined in ansible.el.

Signature

(ansible-vault-string MODE STR)

Documentation

Do ansible-vault MODE on STR and return result.

MODE should be one of decrypt or encrypt.

Source Code

;; Defined in /nix/store/ihs1wd4idvapzygy87ss7ddr2pwcpsxg-emacs-packages-deps/share/emacs/site-lisp/elpa/ansible-20260607.1852/ansible.el
(defun ansible-vault-string (mode str)
  "Do `ansible-vault' MODE on STR and return result.
MODE should be one of `decrypt' or `encrypt'."
  (if (or (string-equal "decrypt" mode) (string-equal "encrypt" mode))
      (let ((output (ansible-vault mode str (ansible-vault-get-password))))

        ;; Clean up any temp password file ansible-vault-get-password may have
        ;; produced.
        (when (and (stringp ansible-vault-store-cleanup-file)
                   (file-exists-p ansible-vault-store-cleanup-file))
          (delete-file ansible-vault-store-cleanup-file)
          (setq ansible-vault-store-cleanup-file nil))

        output)
    (error "MODE should be one of 'encrypt' or 'decrypt'")))