Hi Selvi, Can you please provide content of `/twmn/ansible/collections/ansible_collections/twmn/twmn/roles/iptables/tasks/rules.yml` ? The error suggests that you have not defined `interfaces` variable which is required. It is difficult to answer your question without looking at the role.
Thanks, Abhijeet On Thu, Feb 24, 2022 at 5:52 PM Anushka hasini <[email protected]> wrote: > Hi, > > I have created iptables ansible roles, which contain rules such as Alias > port and Masquerade traffic. I am using molecule to test this role. But > whenever I give empty values for those rules, it is working fine. In the > scenario, if I pass value to the variables assigned to those rules. I am > getting different types of errors. I am testing with docker drivers. For > eg., if I give molecule converge > > Output look like this > > ---------------------------------------------------------------------------------------------------------------- > > TASK [twmn.twmn.iptables : Alias port] > ***************************************** > fatal: [localhost]: FAILED! => {"msg": "The task includes an option with > an undefined variable. The error was: 'interfaces' is undefined\n\nThe > error appears to be in > '/home/hasinianu1217/twmn/ansible/collections/ansible_collections/twmn/twmn/roles/iptables/tasks/rules.yml': > line 4, column 7, but may\nbe elsewhere in the file depending on the exact > syntax problem.\n\nThe offending line appears to be:\n\n- block:\n - > name: Alias port\n ^ here\n"} > > > CRITICAL Ansible return code was 2, command was: ['ansible-playbook', > '--inventory', > '/home/hasinianu1217/.cache/molecule/iptables/default/inventory', > '--skip-tags', 'molecule-notest,notest', > '/home/hasinianu1217/twmn/ansible/collections/ansible_collections/twmn/twmn/roles/iptables/molecule/default/converge.yml'] > > --------------------------------------------------------------------------------------------------------------------------------- > Can anyone clarify me, what is this error look like? > > Thanks > Selvi > > -- > 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/d4e9eb7c-23bc-4c1d-aaa5-3b110ceecba1n%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/d4e9eb7c-23bc-4c1d-aaa5-3b110ceecba1n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Thanks, Abhijeet Kasurde -- 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/CAFwWkHoA06uyMboE7hByXC7tU7%3DLR2%3DW-eiw_ZyW7zUS3RwDiw%40mail.gmail.com.
