When I target CentOS I get this error:

The task includes an option with an undefined variable. The error was: 
{'CentOS': '{{ iptables_directory[ansible_distribution] }}/iptables', 
'Rocky': '{{ iptables_directory[ansible_distribution] }}/iptables', 
'Debian': '{{ iptables_directory[ansible_distribution] }}/rules.v4', 
'Ubuntu': '{{ iptables_directory[ansible_distribution] }}/rules.v4'}: 'dict 
object' has no attribute 'CentOS'. 'dict object' has no attribute 'CentOS'. 

The error appears to be in '/work/armory/roles/xxx/tasks/xxx.yml': line 
266, column 3, but may be elsewhere in the file depending on the exact 
syntax problem.

Default.yml is at the playbook level in a folder called group_vars.  It is 
being read in by my playbook like this:

vars_files:
  - group_vars/default.yml


On Tuesday, February 13, 2024 at 8:53:03 AM UTC-5 Dick Visser wrote:

On Tue, 13 Feb 2024 at 14:22, Kathy L <[email protected]> wrote:

I've been working this issue for a week now. The code used to work 
perfectly and now it fails.  Here is the error I get:


Logic dictates that something has changed. Did you upgrade anything? Or 
otherwise make changes?
That would be the obvious thing to check for you.
 

I get a similar error when I target CentOS 9.


Similar means that it is different. What is the actual error there?
 

  ansible-core 2.14.3
  python 3.11.2
  jinja version = 3.1.2

 

default.yml is being read in as I refer to other variables in the same 
file. Can anyone see an error that I've missed?


Where does this file reside? I.e. how is it "being read in"? 

-- 
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/90394fe7-6ce2-40d5-8233-fdf31b37b499n%40googlegroups.com.

Reply via email to