How to declare that variable to resolve the issue? On Mon, May 17, 2021, 23:12 Dick Visser <[email protected]> wrote:
> On Mon, 17 May 2021 at 19:30, NAVEEN <[email protected]> wrote: > > > > Hello Guys , > > Need help.Written code as below , > > > > --- > > - hosts: localhost > > vars: > > iLo_IP: 'XXXXXXXXXXX' > > iLo_username: 'test' > > iLo_password: 'testuser' > > tasks: > > - name: Get iLO firmware version > > uri: > > url: "https://{{ iLo_IP }}/rest/v1/managers/1" > > method: GET > > user: "{{ ilo_user }}" > > password: "{{ ilo_password }}" > > force_basic_auth: true > > validate_certs: false > > status_code: 200 > > with_items: "{{ ilo_addr.results | > map(attribute='ansible_facts.ipmi') | list }}" > > register: ilo_version > > > > - set_fact: > > ilo_firmware: "{{ item.json.Firmware.Current.VersionString.split(' > v')[-1] | replace('.', '') }}" > > with_items: "{{ ilo_version.results }}" > > no_log: true > > > > > > when i execute this ,I am getting below error.can someone pls help me > out.. > > > > Fatal : [localhost] : FAILED! => { "msg" : "'ilo_addr' is undefined"} > > You're using a variable that is not defined, while looping over the uri > task. > That must have come from somewhere. > So... did you actually write it? Or perhaps copied part of something > else and expected it to magically work. > > > > > -- > > Regards > > Naveen > > > > -- > > 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/CAB_%3D4obzR%2B8oUMVN-TAWKHGAn5N6Q-M_DWYW%3D1ptFCCzaB4euQ%40mail.gmail.com > . > > -- > 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/CAL8fbwO-JnJDnxXeP-T_7qKAEPBebe2Xudo33Rubm62zzDfWow%40mail.gmail.com > . > -- 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/CAB_%3D4oYMv_rW9%2BjSEWBZ4O-iD58%2Bbu0Z_EOaa5SwqaD6pP6emA%40mail.gmail.com.
