0

I am trying to encrypt password "-abc" using ansible-vault. It errors out saying "no such option".

Error is given below,

$ansible-vault encrypt_string '-abc' 
Usage: ansible-vault encrypt_string [--prompt] [options] string_to_encrypt

ansible-vault: error: no such option: -a

Version: ansible 2.7.7; Ubuntu 18

It is a legitimate password used in our system, that begins with '-'.

Kindly advise.

user3362908
  • 433
  • 5
  • 16

1 Answers1

1

Because it takes -a as an option. You should use double dash (--) which means end of command options.

$ansible-vault encrypt_string -- '-abc'
ALFA
  • 1,726
  • 1
  • 10
  • 19