IBM / ansible-for-i

the tool is to provide several customized modules for Ansible to manage IBM i systems.
GNU General Public License v3.0
55 stars 51 forks source link

check_download_ptf_group.yml - The task includes an option with an undefined variable. The error was: 'database' is undefined #101

Closed bricevollmer closed 3 years ago

bricevollmer commented 3 years ago

When using check_download_ptf_group.yml usecase playbook. Fails on undefined database when running ibm.power_ibmi.fix_repo_check_ptf_group role.

ansible-playbook -u userid check_download_ptf_group.yml -e "{'repo_server':server, 'ptf_group':SF99738}"

TASK [ibm.power_ibmi.fix_repo_check_ptf_group : Check if ptf group information is already in catalog's ptf group information table] **** fatal: [server]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'database' is undefined\n\nThe error appears to be in '/home/user/.ansible/collections/ansible_collections/ibm/power_ibmi/roles/fix_repo_check_ptf_group/tasks/main.yml': line 27, 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: Check if ptf group information is already in catalog's ptf group information table\n ^ here\n"}

I have Python3, paramiko, sqllite3 installed on the repo IBMi system. Where is the mentioned 'database' parameter set in this playbook?

pengzengyufish commented 3 years ago

Hi,

Is your fix management code the latest? We deleted the 'database' variable in the latest code.

bricevollmer commented 3 years ago

Hi,

Is your fix management code the latest? We deleted the 'database' variable in the latest code.

Yes, my repository is up to date:

[user@server Operations]$ cd /home/user/ansible-for-i/ [user@server ansible-for-i]$ git pull https://github.com/IBM/ansible-for-i From https://github.com/IBM/ansible-for-i

pengzengyufish commented 3 years ago

Could you upgrade to IBM i ansible to 1.4? We delete the 'database' variable in the latest code.

bricevollmer commented 3 years ago

Are you able to provide galaxy command to upgrade? "ansible-galaxy collection install ibm-power_ibmi --upgrade" did not work for me. I ended up removing the galaxy collection and doing a fresh install to upgrade to 1.4

changlexc commented 3 years ago

I am not sure if you asked about this, "-f" will force the installation. ansible-galaxy collection install ibm.power_ibmi -f

bricevollmer commented 3 years ago

Thanks, that worked to upgrade.

After upgrading, the database variable was removed and I am able to use the fix management collections.