rit001
(Roger)
November 9, 2023, 3:58pm
1
The problem is recorded here
opened 05:42AM - 09 Nov 23 UTC
### Summary
When installing either through the Ansible ppa package or the ansib… le-galaxy command, the `na_ontap_s3_users.py` file has the word `git` before the shebang.
```python
git #!/usr/bin/python
# (c) 2022, NetApp, Inc
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: na_ontap_s3_users
```
Removing this is necessary to make an install from a package complete or to avoid errors when using this module. On my system, this file is installed, by default, to `/usr/lib/python3/dist-packages/ansible_collections/netapp/ontap/plugins/modules/na_ontap_s3_users.py`.
### Component Name
netapp.ontap.na_ontap_s3_users
### Ansible Version
```console
$ ansible --version
ansible [core 2.15.6]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.0.3
libyaml = True
```
### ONTAP Collection Version
```console
$ ansible-galaxy collection list
# /usr/lib/python3/dist-packages/ansible_collections
Collection Version
----------------------------- -------
amazon.aws 6.5.0
ansible.netcommon 5.3.0
ansible.posix 1.5.4
ansible.utils 2.11.0
ansible.windows 1.14.0
arista.eos 6.2.1
awx.awx 22.7.0
azure.azcollection 1.19.0
check_point.mgmt 5.1.1
chocolatey.chocolatey 1.5.1
cisco.aci 2.8.0
cisco.asa 4.0.3
cisco.dnac 6.7.6
cisco.intersight 1.0.27
cisco.ios 4.6.1
cisco.iosxr 5.0.3
cisco.ise 2.5.16
cisco.meraki 2.16.13
cisco.mso 2.5.0
cisco.nso 1.0.3
cisco.nxos 4.4.0
cisco.ucs 1.10.0
cloud.common 2.1.4
cloudscale_ch.cloud 2.3.1
community.aws 6.4.0
community.azure 2.0.0
community.ciscosmb 1.0.7
community.crypto 2.16.0
community.digitalocean 1.24.0
community.dns 2.6.3
community.docker 3.4.10
community.fortios 1.0.0
community.general 7.5.1
community.google 1.0.0
community.grafana 1.6.1
community.hashi_vault 5.0.1
community.hrobot 1.8.1
community.libvirt 1.3.0
community.mongodb 1.6.3
community.mysql 3.8.0
community.network 5.0.2
community.okd 2.3.0
community.postgresql 2.4.3
community.proxysql 1.5.1
community.rabbitmq 1.2.3
community.routeros 2.10.0
community.sap 1.0.0
community.sap_libs 1.4.1
community.skydive 1.0.0
community.sops 1.6.7
community.vmware 3.11.1
community.windows 1.13.0
community.zabbix 2.1.0
containers.podman 1.11.0
cyberark.conjur 1.2.2
cyberark.pas 1.0.23
dellemc.enterprise_sonic 2.2.0
dellemc.openmanage 7.6.1
dellemc.powerflex 1.9.0
dellemc.unity 1.7.1
f5networks.f5_modules 1.27.0
fortinet.fortimanager 2.3.0
fortinet.fortios 2.3.4
frr.frr 2.0.2
gluster.gluster 1.0.2
google.cloud 1.2.0
grafana.grafana 2.2.3
hetzner.hcloud 1.16.0
hpe.nimble 1.1.4
ibm.qradar 2.1.0
ibm.spectrum_virtualize 1.12.0
ibm.storage_virtualize 2.1.0
infinidat.infinibox 1.3.12
infoblox.nios_modules 1.5.0
inspur.ispim 1.3.0
inspur.sm 2.3.0
junipernetworks.junos 5.3.0
kubernetes.core 2.4.0
lowlydba.sqlserver 2.2.2
microsoft.ad 1.3.0
netapp.aws 21.7.1
netapp.azure 21.10.1
netapp.cloudmanager 21.22.1
netapp.elementsw 21.7.0
netapp.ontap 22.8.1
netapp.storagegrid 21.11.1
netapp.um_info 21.8.1
netapp_eseries.santricity 1.4.0
netbox.netbox 3.15.0
ngine_io.cloudstack 2.3.0
ngine_io.exoscale 1.1.0
ngine_io.vultr 1.1.3
openstack.cloud 2.1.0
openvswitch.openvswitch 2.1.1
ovirt.ovirt 3.2.0
purestorage.flasharray 1.21.0
purestorage.flashblade 1.14.0
purestorage.fusion 1.6.0
sensu.sensu_go 1.14.0
servicenow.servicenow 1.0.6
splunk.es 2.1.0
t_systems_mms.icinga_director 1.33.1
telekom_mms.icinga_director 1.34.1
theforeman.foreman 3.14.0
vmware.vmware_rest 2.3.1
vultr.cloud 1.10.0
vyos.vyos 4.1.0
wti.remote 1.0.5
```
### ONTAP Version
```console
N/A - error happens on install of Ansible
```
### Playbook
```console
N/A - error happens on install of Ansible
```
### Steps to Reproduce
On Ubuntu Jammy (22.04.3 in my case) with the Ansible official PPA enabled, attempt to install or upgrade the ansible package.
### Expected Results
I expected the default collections to install alongside ansible and configure appropriately, including the netapp.ontap collection.
### Actual Results
```console
Upon install or upgrade, a syntax error in the netapp.ontap module causes the install to break.
$ apt upgrade -y
--- output cut ---
Setting up ansible (8.6.0-1ppa~jammy) ...
File "/usr/lib/python3/dist-packages/ansible_collections/netapp/ontap/plugins/modules/na_ontap_s3_users.py", line 7
from __future__ import absolute_import, division, print_function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: from __future__ imports must occur at the beginning of the file
dpkg: error processing package ansible (--configure):
installed ansible package post-installation script subprocess returned error exit status 1
```
The problem is that the reported issue is not within the above repo, instead an error seems to have found its way into the building of the ppa, which is a separate team/group/system over at Ansible in Launchpad
I do not know the Ansible ecosystem well enough to know who to raise the issue with and it seems that each repo involved is only focused on its own role within the process rather than the overall process of delivering working packages to end users.
Somehow the text 'git ’ has been added to the start of a php file which means that the file causes an error when processed with the result that Ansible 8.6 installs will fail. The issue is not who/what caused it, but who/what can resolve the issue.
The issue was with the collection, it was published from a dirty checkout (that contained that git
before the shebang). It got resolved in the meantime, and Ansible 8.6.1 got released with that fix included.
In this forum, it’s best to ping release-managers (I’ve intentionally not added the @
to avoid pinging them) in case of such problems, since they are responsible for releasing the ansible
package (from which the PPA is built). Creating an issue in the ansible-build-data GitHub repository also works. That’s the main repository for building and releasing Ansible.
rit001
(Roger)
November 10, 2023, 12:38am
3
Thanks for the reply and update, I was following threads across repos watching the fix as it progressed.
Your last comment about using ansible-build-data is something that is not very clear from the overall project and all its repos. Maybe someone could make it clear in the readme file regarding what types of issues can be handled by raising issues there.
1 Like