Hi,

Yes (I have secrets here, then I cut):
One file example is: inventory/dev/ssh.yml

Then the sops encrypted file has this text in clear (sops -d file):

# This file is...
data: 
   sshpriv1: | 
        TEXT1
   sshpub.pub: |
        TEXT2

The warnings show like:
[WARNING]: Skipping key (MYKEY1) in group (data) as it is not a mapping, it 
is a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> 
[WARNING]: Skipping key (MYKEY2) in group (data) as it is not a mapping, it 
is a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> 
[WARNING]: Skipping key (MYKEY3 ) in group (data) as it is not a mapping, 
it is a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> 
[WARNING]: Skipping key (MYKEY4) in group (data) as it is not a mapping, it 
is a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> 
[WARNING]: Skipping key (kms) in group (sops) as it is not a mapping, it is 
a <class 'ansible.parsing.yaml.objects.AnsibleSequence'> 
[WARNING]: Skipping key (gcp_kms) in group (sops) as it is not a mapping, 
it is a <class 'ansible.parsing.yaml.objects.AnsibleSequence'> 
[WARNING]: Skipping key (azure_kv) in group (sops) as it is not a mapping, 
it is a <class 'ansible.parsing.yaml.objects.AnsibleSequence'> 
[WARNING]: Skipping key (hc_vault) in group (sops) as it is not a mapping, 
it is a <class 'ansible.parsing.yaml.objects.AnsibleSequence'> 
[WARNING]: Skipping key (age) in group (sops) as it is not a mapping, it is 
a <class 'ansible.parsing.yaml.objects.AnsibleSequence'> 
[WARNING]: Skipping key (lastmodified) in group (sops) as it is not a 
mapping, it is a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> 
[WARNING]: Skipping key (mac) in group (sops) as it is not a mapping, it is 
a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> 
[WARNING]: Skipping key (pgp) in group (sops) as it is not a mapping, it is 
a <class 'ansible.parsing.yaml.objects.AnsibleSequence'> 
[WARNING]: Skipping key (unencrypted_suffix) in group (sops) as it is not a 
mapping, it is a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> 
[WARNING]: Skipping key (version) in group (sops) as it is not a mapping, 
it is a <class 'ansible.parsing.yaml.objects.AnsibleUnicode'>

The playbook works, but show these warns.
ansible-playbook -v -i inventory/dev ...

Also I'm using in Ansible configuration file:
callback_result_format=yaml

The sops version is 3.7.3.

Ah, at the moment that I write this, the inventory file is:
inventory/dev/hosts.yml

When I change the launch as:
ansible-playbook -v -i inventory/dev/hosts.yml ...

The warns dissapear. Hum, howto exclude with Ansible any encrypted files to 
use "inventory/dev"?
Or howto reorder this structure?


Regards,
Cesar Jorge 


El martes, 12 de septiembre de 2023 a las 16:12:17 UTC+2, Brian Coca 
escribió:

> You do not give enough details, the message seems to indicate
> malformed YAML, could you show the files involved?
>
>
> -- 
> ----------
> Brian Coca
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/538303bc-a500-45cf-a519-1c613440f3afn%40googlegroups.com.

Reply via email to