This might be tough to get working because "subl" returns immediately to 
the shell after opening the file, which means ansible-vault can't 
re-encrypt after you're done editing. You should probably stick with 
encrypt/decrypt and editing manually. What would be really cool is a 
Sublime Text plugin for vault!

-Tim

On Thursday, February 27, 2014 11:02:33 AM UTC-8, Kesten Broughton wrote:
>
> I can encrypt and decrypt but i haven't been able to get edit to work.
>
> I'm running on a mac.  In my bash_profile i have aliases to sublime
>
>
> ---------- .bash_profile --------------
>
> alias edit='/Applications/Sublime\ Text\ 
> 2.app/Contents/SharedSupport/bin/subl'
>
> # a sudo version for when you need to edit /opt/<file> or other sudo owned 
> files
>
> alias sedit='sudo /Applications/Sublime\ Text\ 
> 2.app/Contents/SharedSupport/bin/subl'
>
> # define EDITOR or ansible-vault
>
>
> # Tried several things
>
> export EDITOR=edit  # Command not found
>
> alias EDITOR=edit  #  Permission denied
>
> alias EDITO=sedit 
>
>
> ---------- end  .bash_profile --------------
>
> *[**kbroughton@mb-kbroughton*:*lynx-ansible/dev-ansible** + 
> (develop)]*ansible-vault encrypt sudoers
>
> Vault password: 
>
> Confirm Vault password: 
>
> Encryption successful
>
> *[**kbroughton@mb-kbroughton*:*lynx-ansible/dev-ansible** + 
> (develop)]*ansible-vault decrypt sudoers
>
> Vault password: 
>
> Decryption successful
>
>
> *[**kbroughton@mb-kbroughton*:*lynx-ansible/dev-ansible** + 
> (develop)]*ansible-vault edit -d sudoers
>
> Vault password: 
>
> Traceback (most recent call last):
>
>   File "/Users/kbroughton/vcp/git/mentat/ansible/bin/ansible-vault", line 
> 182, in main
>
>     fn(args, options, parser)
>
>   File "/Users/kbroughton/vcp/git/mentat/ansible/bin/ansible-vault", line 
> 141, in execute_edit
>
>     this_editor.edit_file()
>
>   File 
> "/Users/kbroughton/vcp/git/mentat/ansible/lib/ansible/utils/vault.py", line 
> 188, in edit_file
>
>     call([EDITOR, tmp_path])
>
>   File 
> "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
>  
> line 522, in call
>
>     return Popen(*popenargs, **kwargs).wait()
>
>   File 
> "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
>  
> line 709, in __init__
>
>     errread, errwrite)
>
>   File 
> "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
>  
> line 1326, in _execute_child
>
>     raise child_exception
>
> OSError: [Errno 13] Permission denied
>
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/016ae5cb-8042-4f65-9bd6-738ba5d96062%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to