Comments (9)
Did you check previous step in execution log that it registered that variable? It is possible it did not find any files, therefore item was not defined.
I have been running it in current state and I never had this issue with .item.
- name: SAP SWPM - Find sapcontrol log file/s
ansible.builtin.find:
paths: "{{ swpm_last_install_path.stdout }}"
recurse: false
file_type: file
patterns: '.*sapcontrol.*log'
use_regex: true
register: swpm_output_sapcontrol_files
from community.sap_install.
@rnozaki I had the same error when testing an S/4HANA Foundation 2022 installation last week but I could not finish my investigation. Trying to reproduce it again now and also testing the solution you proposed.
from community.sap_install.
Did you check previous step in execution log that it registered that variable? It is possible it did not find any files, therefore item was not defined.
I have been running it in current state and I never had this issue with .item.
- name: SAP SWPM - Find sapcontrol log file/s ansible.builtin.find: paths: "{{ swpm_last_install_path.stdout }}" recurse: false file_type: file patterns: '.*sapcontrol.*log' use_regex: true register: swpm_output_sapcontrol_files
As I mentioned, I tested the new code with the exact same conditions it was working before.
And when I added the new label, it found the element.
So in my case, just fixing the label solved the problem.
Have you executed this code in your environment?
from community.sap_install.
Did you check previous step in execution log that it registered that variable? It is possible it did not find any files, therefore item was not defined.
I have been running it in current state and I never had this issue with .item.- name: SAP SWPM - Find sapcontrol log file/s ansible.builtin.find: paths: "{{ swpm_last_install_path.stdout }}" recurse: false file_type: file patterns: '.*sapcontrol.*log' use_regex: true register: swpm_output_sapcontrol_files
As I mentioned, I tested the new code with the exact same conditions it was working before. And when I added the new label, it found the element. So in my case, just fixing the label solved the problem.
Have you executed this code in your environment?
That is why I was mentioning previous step. It would be good to know what was actual content of your "{{ swpm_output_sapcontrol_files }}" variable and if it contains array with items.
I have run this role 20+ times over last 2 weeks (ASCS/ERS, S4H, NW) and it never failed with this error, even if SWPM was successful or failed.
from community.sap_install.
Did you check previous step in execution log that it registered that variable? It is possible it did not find any files, therefore item was not defined.
I have been running it in current state and I never had this issue with .item.- name: SAP SWPM - Find sapcontrol log file/s ansible.builtin.find: paths: "{{ swpm_last_install_path.stdout }}" recurse: false file_type: file patterns: '.*sapcontrol.*log' use_regex: true register: swpm_output_sapcontrol_files
As I mentioned, I tested the new code with the exact same conditions it was working before. And when I added the new label, it found the element. So in my case, just fixing the label solved the problem.
Have you executed this code in your environment?That is why I was mentioning previous step. It would be good to know what was actual content of your "{{ swpm_output_sapcontrol_files }}" variable and if it contains array with items.
I have run this role 20+ times over last 2 weeks (ASCS/ERS, S4H, NW) and it never failed with this error, even if SWPM was successful or failed.
Have you run it in the last 3 days? Because this is when the PR 665 was merged.
from community.sap_install.
Sorry @rnozaki , it seems @berndfinger moved his PR and it changed items as you said. I have not tested it with his PR. You can disregard my comments.
from community.sap_install.
@rnozaki @marcelmamula In #665, I overlooked the fact that the loop variable from the task SAP SWPM - Get sapcontrol file/s
is re-used for the label in the task SAP SWPM - Display status from sapcontrol file/s
.
Thanks for solving the problem @rnozaki!
from community.sap_install.
Solved in #682.
from community.sap_install.
FYI - Test playbook for those who want to reproduce the problem:
- name: junk
hosts: localhost
vars:
dummy:
- 'test1'
- 'test2'
gather_facts: no
tasks:
- name: Display the list
ansible.builtin.debug:
msg: "{{ dummy }}"
- name: Run command and register output with new loop_var
ansible.builtin.command: "echo {{ line_item }}"
register: output
loop: "{{ dummy }}"
loop_control:
loop_var: line_item
- name: Display output with correct loop label
ansible.builtin.debug:
msg: "{{ command_output.stdout_lines }}"
loop: "{{ output.results }}"
loop_control:
loop_var: command_output
label: "{{ command_output.line_item }}"
- name: Display output with wrong loop label
ansible.builtin.debug:
msg: "{{ command_output.stdout_lines }}"
loop: "{{ output.results }}"
loop_control:
loop_var: command_output
label: "{{ command_output.item }}"
from community.sap_install.
Related Issues (20)
- sap_general_preconfigure: DNS check ignores A/PTR record insonsistencies HOT 3
- Workflows: Add missing `---` HOT 2
- sap_install_media_detect: Not all files in non-extract subdirectories are detected for moving back files to the top level HOT 1
- collection: Fix incorrect ansible-galaxy commands for installing collections in several README.md files
- sap_hana_preconfigure/RHEL: Add RHEL 9.4 requirements after the HANA validation has completed. HOT 1
- collection: Add SPDX headers to all files of the collection HOT 2
- sap_install_media_detect: reduce stdout with loop labels HOT 1
- sap_hana_preconfigure/RHEL: Set net.core.somaxconn only for RHEL <= 8.7
- sap_general_preconfigure: The strict DNS check enforcement of PR 765 causes failures in certain cloud environments HOT 4
- sap_hana_install : SAP HANA Checks - Fail if the user 'sidadm' exists HOT 2
- sap_hana_install: Do not fail if sap_hana_install_common_master_password is not set. HOT 1
- sap_hana_preconfigure/SLES: sap_hana_preconfigure_update needs validation/wait HOT 1
- sap_swpm: unhandled exception when using sap_swpm_swpm_observer_mode...
- sap_hana_preconfigure/RHEL: tsx kernel parameters not set for RHEL9 HOT 2
- sap_hana/sap_swpm: Linux Special Characters HOT 2
- sap_storage_setup: README.MD example is wrong, please fix it.
- sap_hana_install: Use polling for hdblcm HOT 1
- collection: Fix 'yaml[octal-values]'
- sap_hana_preconfigure/RHEL/NetApp: Sync with SAP note 3024346 v.10 HOT 2
- sap_hana_preconfigure/RHEL/NetApp: Ensure two NetApp related kernel parameters are not present in file sap_hana.conf
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from community.sap_install.