gregsowell / ansible-cisco

General Cisco plays and roles
7 stars 8 forks source link

ACI EPG loop not working #1

Open wissambteich opened 3 years ago

wissambteich commented 3 years ago

Hello,

First, I want to thank gregsowell for the valuable information he is sharing.

I am trying to run the ansible playbook for ACI EPG and I am encountering the following error:

{"msg": "The task includes an option with an undefined variable. The error was: 'all_epg' is undefined \n\nThe error appears to be in 'etc/ansible/aci_pushconfig.yml" etc...

Appreciate the help.

Regards,

gregsowell commented 3 years ago

The very last task is just so:

The loop option will loop over that specific variable and by default will make the variable name show up as "item" in the task. I wanted to change that default behavior, so I added loop_control and set the loop_var to something other than "item"; in this case I set it to "all_epgs".

You will want to check and ensure that the loop_control and loop_var section are in place as shown here.

Thanks, Greg

On Wed, Apr 7, 2021 at 4:31 AM wissambteich @.***> wrote:

Hello,

First, I want to thank gregsowell for the valuable information he is sharing.

I am trying to run the ansible playbook for ACI EPG and I am encountering the following error:

{"msg": "The task includes an option with an undefined variable. The error was: 'all_epg' is undefined \n\nThe error appears to be in 'etc/ansible/aci_pushconfig.yml" etc...

Appreciate the help.

Regards,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMR6A3AJJUZMJ5SJ7K5OFDTHQQ5ZANCNFSM42QNHYHA .

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

wissambteich commented 3 years ago

Thank you for your reply.

I entered exactly the same code for the below task and I still get the same error I don’t know why.

If I want to go with default without using the loop_var, should I omit the last two lines? (loop_control & loop_var)

Regards,

From: Greg Sowell @.> Sent: Wednesday, April 7, 2021 4:25 PM To: gregsowell/ansible-cisco @.> Cc: Wissam Bteich @.>; Author @.> Subject: Re: [gregsowell/ansible-cisco] ACI EPG loop not working (#1)

The very last task is just so:

The loop option will loop over that specific variable and by default will make the variable name show up as "item" in the task. I wanted to change that default behavior, so I added loop_control and set the loop_var to something other than "item"; in this case I set it to "all_epgs".

You will want to check and ensure that the loop_control and loop_var section are in place as shown here.

Thanks, Greg

On Wed, Apr 7, 2021 at 4:31 AM wissambteich @.<mailto:@.>> wrote:

Hello,

First, I want to thank gregsowell for the valuable information he is sharing.

I am trying to run the ansible playbook for ACI EPG and I am encountering the following error:

{"msg": "The task includes an option with an undefined variable. The error was: 'all_epg' is undefined \n\nThe error appears to be in 'etc/ansible/aci_pushconfig.yml" etc...

Appreciate the help.

Regards,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMR6A3AJJUZMJ5SJ7K5OFDTHQQ5ZANCNFSM42QNHYHA .

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814912307, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APGIKL3QJOURS3AZK5DLKITTHRMMRANCNFSM42QNHYHA.

gregsowell commented 3 years ago

Indeed; omit the last two lines and replace "all_epgs" with "item".

On Wed, Apr 7, 2021 at 8:44 AM wissambteich @.***> wrote:

Thank you for your reply.

I entered exactly the same code for the below task and I still get the same error I don’t know why.

If I want to go with default without using the loop_var, should I omit the last two lines? (loop_control & loop_var)

Regards,

From: Greg Sowell @.> Sent: Wednesday, April 7, 2021 4:25 PM To: gregsowell/ansible-cisco @.> Cc: Wissam Bteich @.>; Author @.> Subject: Re: [gregsowell/ansible-cisco] ACI EPG loop not working (#1)

The very last task is just so:

  • name: Add new EPGs aci_epg: host: "{{ aci_host }}" username: "{{ aci_username }}" password: "{{ aci_password }}" tenant: "{{ aci_tenant }}" ap: "{{ aci_ap_name }}" epg: "{{ all_epgs._epg }}" description: "{{ all_epgs._desc}}" bd: "{{ aci_bd }}" priority: unspecified intra_epg_isolation: unenforced state: present validate_certs: false loop: "{{ aci_epgs }}" loop_control: loop_var: all_epgs

The loop option will loop over that specific variable and by default will make the variable name show up as "item" in the task. I wanted to change that default behavior, so I added loop_control and set the loop_var to something other than "item"; in this case I set it to "all_epgs".

You will want to check and ensure that the loop_control and loop_var section are in place as shown here.

Thanks, Greg

On Wed, Apr 7, 2021 at 4:31 AM wissambteich @.<mailto:@.>>

wrote:

Hello,

First, I want to thank gregsowell for the valuable information he is sharing.

I am trying to run the ansible playbook for ACI EPG and I am encountering the following error:

{"msg": "The task includes an option with an undefined variable. The error was: 'all_epg' is undefined \n\nThe error appears to be in 'etc/ansible/aci_pushconfig.yml" etc...

Appreciate the help.

Regards,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOMR6A3AJJUZMJ5SJ7K5OFDTHQQ5ZANCNFSM42QNHYHA>

.

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814912307>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/APGIKL3QJOURS3AZK5DLKITTHRMMRANCNFSM42QNHYHA>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814925939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMR6AZKBKIPCH7HTEKQROTTHROUXANCNFSM42QNHYHA .

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

wissambteich commented 3 years ago

Now I’m having ‘item’ is undefined instead of ‘all_epgs’ ☺ Maybe I should define it somewhere..

Regards,

From: Greg Sowell @.> Sent: Wednesday, April 7, 2021 4:56 PM To: gregsowell/ansible-cisco @.> Cc: Wissam Bteich @.>; Author @.> Subject: Re: [gregsowell/ansible-cisco] ACI EPG loop not working (#1)

Indeed; omit the last two lines and replace "all_epgs" with "item".

On Wed, Apr 7, 2021 at 8:44 AM wissambteich @.***> wrote:

Thank you for your reply.

I entered exactly the same code for the below task and I still get the same error I don’t know why.

If I want to go with default without using the loop_var, should I omit the last two lines? (loop_control & loop_var)

Regards,

From: Greg Sowell @.> Sent: Wednesday, April 7, 2021 4:25 PM To: gregsowell/ansible-cisco @.> Cc: Wissam Bteich @.>; Author @.> Subject: Re: [gregsowell/ansible-cisco] ACI EPG loop not working (#1)

The very last task is just so:

  • name: Add new EPGs aci_epg: host: "{{ aci_host }}" username: "{{ aci_username }}" password: "{{ aci_password }}" tenant: "{{ aci_tenant }}" ap: "{{ aci_ap_name }}" epg: "{{ all_epgs._epg }}" description: "{{ all_epgs._desc}}" bd: "{{ aci_bd }}" priority: unspecified intra_epg_isolation: unenforced state: present validate_certs: false loop: "{{ aci_epgs }}" loop_control: loop_var: all_epgs

The loop option will loop over that specific variable and by default will make the variable name show up as "item" in the task. I wanted to change that default behavior, so I added loop_control and set the loop_var to something other than "item"; in this case I set it to "all_epgs".

You will want to check and ensure that the loop_control and loop_var section are in place as shown here.

Thanks, Greg

On Wed, Apr 7, 2021 at 4:31 AM wissambteich @.<mailto:@.>>

wrote:

Hello,

First, I want to thank gregsowell for the valuable information he is sharing.

I am trying to run the ansible playbook for ACI EPG and I am encountering the following error:

{"msg": "The task includes an option with an undefined variable. The error was: 'all_epg' is undefined \n\nThe error appears to be in 'etc/ansible/aci_pushconfig.yml" etc...

Appreciate the help.

Regards,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOMR6A3AJJUZMJ5SJ7K5OFDTHQQ5ZANCNFSM42QNHYHA>

.

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814912307>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/APGIKL3QJOURS3AZK5DLKITTHRMMRANCNFSM42QNHYHA>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814925939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMR6AZKBKIPCH7HTEKQROTTHROUXANCNFSM42QNHYHA .

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814935397, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APGIKL6O4YYVTX5OOR2SG7DTHRP77ANCNFSM42QNHYHA.

gregsowell commented 3 years ago

Hmmmmm, sounds like something's just not right.

On Wed, Apr 7, 2021 at 9:04 AM wissambteich @.***> wrote:

Now I’m having ‘item’ is undefined instead of ‘all_epgs’ ☺ Maybe I should define it somewhere..

Regards,

From: Greg Sowell @.> Sent: Wednesday, April 7, 2021 4:56 PM To: gregsowell/ansible-cisco @.> Cc: Wissam Bteich @.>; Author @.> Subject: Re: [gregsowell/ansible-cisco] ACI EPG loop not working (#1)

Indeed; omit the last two lines and replace "all_epgs" with "item".

On Wed, Apr 7, 2021 at 8:44 AM wissambteich @.***> wrote:

Thank you for your reply.

I entered exactly the same code for the below task and I still get the same error I don’t know why.

If I want to go with default without using the loop_var, should I omit the last two lines? (loop_control & loop_var)

Regards,

From: Greg Sowell @.> Sent: Wednesday, April 7, 2021 4:25 PM To: gregsowell/ansible-cisco @.> Cc: Wissam Bteich @.>; Author @.> Subject: Re: [gregsowell/ansible-cisco] ACI EPG loop not working (#1)

The very last task is just so:

  • name: Add new EPGs aci_epg: host: "{{ aci_host }}" username: "{{ aci_username }}" password: "{{ aci_password }}" tenant: "{{ aci_tenant }}" ap: "{{ aci_ap_name }}" epg: "{{ all_epgs._epg }}" description: "{{ all_epgs._desc}}" bd: "{{ aci_bd }}" priority: unspecified intra_epg_isolation: unenforced state: present validate_certs: false loop: "{{ aci_epgs }}" loop_control: loop_var: all_epgs

The loop option will loop over that specific variable and by default will make the variable name show up as "item" in the task. I wanted to change that default behavior, so I added loop_control and set the loop_var to something other than "item"; in this case I set it to "all_epgs".

You will want to check and ensure that the loop_control and loop_var section are in place as shown here.

Thanks, Greg

On Wed, Apr 7, 2021 at 4:31 AM wissambteich @.<mailto:@.>>

wrote:

Hello,

First, I want to thank gregsowell for the valuable information he is sharing.

I am trying to run the ansible playbook for ACI EPG and I am encountering the following error:

{"msg": "The task includes an option with an undefined variable. The error was: 'all_epg' is undefined \n\nThe error appears to be in 'etc/ansible/aci_pushconfig.yml" etc...

Appreciate the help.

Regards,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOMR6A3AJJUZMJ5SJ7K5OFDTHQQ5ZANCNFSM42QNHYHA>

.

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<

https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814912307>,

or unsubscribe<

https://github.com/notifications/unsubscribe-auth/APGIKL3QJOURS3AZK5DLKITTHRMMRANCNFSM42QNHYHA>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814925939>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOMR6AZKBKIPCH7HTEKQROTTHROUXANCNFSM42QNHYHA>

.

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814935397>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/APGIKL6O4YYVTX5OOR2SG7DTHRP77ANCNFSM42QNHYHA>.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gregsowell/ansible-cisco/issues/1#issuecomment-814941918, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMR6A35ZGENQ2E3Y3PXCGDTHRQ6RANCNFSM42QNHYHA .

--

GregSowell.com TheBrothersWISP.com StrayaNet.com WhyAmIPod.com