---
the_dev_secret: !vault |
$ANSIBLE_VAULT;1.1;AES256
62613163386132636435396436326334366331356239343739656630346330346562316435316639
3835326137353666393832613939626630313432393166360a373966333035393037663833363564
34373161383766353963393866396264653166346330663264626261646631306235393531653039
6565306230373338330a623232336533633861343431633763663530383238616137383364333862
3134
YamlConfig config = new YamlConfig();
config.setClassTag("vault", String.class);
YamlReader reader = new YamlReader(fileContent, config);
Object yaml = reader.read();
--
--
You received this message because you are subscribed to the "yamlbeans-users" group:
http://groups.google.com/group/yamlbeans-users
---
You received this message because you are subscribed to the Google Groups "yamlbeans-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
the_dev_secret-tag: vaultthe_dev_secret: |- $ANSIBLE_VAULT;1.1;AES256 <snip>
the_dev_secret: !vault |
$ANSIBLE_VAULT;1.1;AES256
<snip>
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-use...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-users+unsubscribe@googlegroups.com.
foo: foo1: bar1
foo: !java.util.LinkedHashMap foo1: bar1
the_dev_secret: !vault | $ANSIBLE_VAULT;1.1;AES256
the_dev_secret: !vault |- $ANSIBLE_VAULT;1.1;AES256
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-users+unsubscribe@googlegroups.com.
Enter coYamlConfig config = new YamlConfig();
config.readConfig.setClassTags(false);
config.setTagSuffix("-tag");
config.writeConfig.setWriteRootTags(false);
YamlWriter writer = new YamlWriter(stringWriter, config);
writer.write(yaml);
writer.close();
String s = stringWriter.toString();de here...
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/home/robert/Documents/workspaces/Ansible/ansible_sandbox/ansible_encrypted_vars/group_vars/all.yml': line 1, column 6, but maybe elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
foo: !java.util.LinkedHashMap ^ here
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-users+unsubscribe@googlegroups.com.
@Test
public void testYamlFileWithEncryptedVarsE2E() throws YamlException {
String yamlFileContent = "---\n" +
"foo:\n" +
" bar1: 1\n" +
" bar2: 2\n" +
"the_dev_secret: !vault |\n" +
" $ANSIBLE_VAULT;1.1;AES256\n" +
" 62613163386132636435396436326334366331356239343739656630346330346562316435316639\n" +
" 3835326137353666393832613939626630313432393166360a373966333035393037663833363564\n" +
" 34373161383766353963393866396264653166346330663264626261646631306235393531653039\n" +
" 6565306230373338330a623232336533633861343431633763663530383238616137383364333862\n" +
" 3134\n";
// Config
YamlConfig config = new YamlConfig();
config.readConfig.setClassTags(false);
config.setTagSuffix("-tag");
config.writeConfig.setWriteRootTags(false);
config.writeConfig.setIndentSize(2);
// read YML file
YamlReader reader = new YamlReader(yamlFileContent, config);
Map yaml = (Map) reader.read();
// write back to file
StringWriter stringWriter = new StringWriter();
YamlWriter writer = new YamlWriter(stringWriter, config);
writer.write(yaml);
writer.close();
String s = stringWriter.toString();
assertEquals(yamlFileContent, s);
}
---foo: bar1: 1 bar2: 2
the_dev_secret: !vault | $ANSIBLE_VAULT;1.1;AES256 62613163386132636435396436326334366331356239343739656630346330346562316435316639 3835326137353666393832613939626630313432393166360a373966333035393037663833363564 34373161383766353963393866396264653166346330663264626261646631306235393531653039 6565306230373338330a623232336533633861343431633763663530383238616137383364333862 3134
foo: !java.util.LinkedHashMap bar1: '1' bar2: '2'
the_dev_secret: !vault |- $ANSIBLE_VAULT;1.1;AES256
62613163386132636435396436326334366331356239343739656630346330346562316435316639 3835326137353666393832613939626630313432393166360a373966333035393037663833363564 34373161383766353963393866396264653166346330663264626261646631306235393531653039 6565306230373338330a623232336533633861343431633763663530383238616137383364333862 3134
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-users+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-users+unsubscribe@googlegroups.com.