Closed abegosum closed 12 months ago
Another note on recreation of the issue- you can install the collection directly from ansible-galaxy into a test directory and the same typo will appear.
# ansible-galaxy collection install --force -p ./anstest netapp.ontap
Starting galaxy collection install process
[WARNING]: The specified collections path '/root/anstest' is not part of the configured Ansible collections paths
'/root/.ansible/collections:/usr/share/ansible/collections'. The installed collection will not be picked up in an Ansible run, unless within a playbook-
adjacent collections directory.
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/netapp-ontap-22.8.1.tar.gz to /root/.ansible/tmp/ansible-local-93123mqb2qvxe/tmph7np_ld7/netapp-ontap-22.8.1-ju5on8hg
Installing 'netapp.ontap:22.8.1' to '/root/anstest/ansible_collections/netapp/ontap'
netapp.ontap:22.8.1 was installed successfully
# head anstest/ansible_collections/netapp/ontap/plugins/modules/na_ontap_s3_users.py
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
I just ran into this too when upgrading Ansible to 8.6.0 on Ubuntu 22.04, got the same result. Manually removing git
before the shebang of /usr/lib/python3/dist-packages/ansible_collections/netapp/ontap/plugins/modules/na_ontap_s3_users.py
has solved the issue.
I can confirm this on multiple systems. Removing the String git
in the first line resolves the issue (at least for me).
My Canary deployment system is showing this as a 'show-stopper' for our environment if I were to deploy any real systems.
Typos into the wrong window are a common issue, so this is a minor error, that is showing a limitation of whatever CI process is currently in place for the repo.
Just to be clear this seems to be an error that is part of the Ansible 8.6.0 release as I can not find the error within this repo or recent past releases.
The main branch in this repo don't seams to not have the issues https://github.com/ansible-collections/netapp.ontap/blob/main/plugins/modules/na_ontap_s3_users.py
This leads my to assume one (or both) of the following:
Ether way a new release is appreciated :)
Opened as an issue over at https://github.com/ansible-community/ppa/issues/77
Thank you for your interest in Ansible. Unfortunately the maintainers of this repo do not control either the netapp.ontapp collection, nor the ansible
package. This repository is specifically for the ansible-core
package.
As I see above, there is already an issue open for the netapp.ontapp repository, but it looks like there are some requests to have a new ansible
package released. You will need to consult the maintainers of the ansible
package at https://github.com/ansible-community/ansible-build-data or through the community communication mechanisms listed at https://docs.ansible.com/ansible/latest/community/communication.html
Ffs, this repo is called "netapp.ontap"! What are you doing here then? And why the hell does the "Issue tracker" on the collection's page point here?
The problem wasn't in the Ansible package, we just can't install it because of the issue of the ontap collection!
I apologize, that's my mistake, I got the tabs mixed up.
OK, while people are getting their wire's crossed there is a larger issue - where on Earth has the building of the Ansible distribution pulled in this typo?
This repo does not seem to record the change to the file that is now causing the issue with the final 8.6.0 Ansible distribution. So is anyone understands the workflow that connects these 2 independent projects could they take a look around?
https://galaxy.ansible.com/ui/repo/published/netapp/ontap/docs/ links to here for the Issue Tracker.
I question why the netapp collection is included by default.
So uh, does this mean this is built and pushed from a local developer machine?
So uh, does this mean this is built and pushed from a local developer machine?
I'm guessing so. The repo doesn't contain that, but it's in the artifact pushed to galaxy. So it would seem the local repo is "dirty" and was used in that state to build the artifact from.
Heh, since I have your attention @sivel, are there any kind of build/release standards/requirements for inclusion in default collections? If not, should there be, in light of a pushed artifact that was apparently built from a dirty tree?
It does make me wonder what other things are dirty in that collection.
When following the build process for ppa distributions I ended up at the following
https://github.com/ansible-community/ppa/issues/77
So people are asking the same questions, in the right place :)
The build process seems to be github driven, so something went badly wrong to end up with 'git ' being added to a random file.
@rit001 nope, the artifact on Ansible Galaxy has the git
addition as well.
And the tests for this collection have been failing for quite some time.
https://github.com/ansible-collections/netapp.ontap/actions/workflows/main.yml
If you drill down into individual test runs, it shows they've been failing on 2.15 which is used in ansible 8.6- https://github.com/ansible-community/ansible-build-data/blob/f4f81a908d6bc4f92212d62282ad49759a157f93/8/ansible-8.6.0.deps#L2
@lattwood unfortunately I cannot really help there. While I'm a dev for ansible-core, I have no real interaction with the packaging of the ansible
package. There were sanity tests that ran during the process of creating the ansible
package, but I have no current knowledge of whether that is still done. It would have been caught by ansible-test
, at minimum by the validate-modules
or the import
tests:
ERROR: plugins/modules/na_ontap_s3_users.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'from __future__ imports must occur at the beginning of the file (na_ontap_s3_users.py, line 7)'
ERROR: plugins/modules/na_ontap_s3_users.py:7:0: traceback: SyntaxError: from __future__ imports must occur at the beginning of the file
Well, here's one thing to be relieved over. This is the only file that was impacted.
I'll get a fix out for this today.
I'm going to fix this directly in Github. As i don't see this in our internal version.
Should have the fix out on galaxy in a few minutes
I pushed the fix out and it on Galaxy.
https://galaxy.ansible.com/ui/repo/staging/netapp/ontap/?version=22.8.2
It looks like a file was touched in pipeline release git repo. The change was never checked in to either our bitbucket or github repo.
I"ll modify our internal pipeline to do a fresh git clone from now when building new releases.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: ansible_collections/netapp/ontap/plugins/modules/na_ontap_s3_users.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
ansible_collections/netapp/ontap/netapp-ontap-21.10.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.11.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.12.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.13.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.13.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.14.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.14.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.15.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.15.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.16.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.17.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.17.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.17.2.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.17.3.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.18.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.18.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.19.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.19.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.20.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.22.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.23.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.24.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.24.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.6.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.6.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.7.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.8.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.8.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-21.9.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.0.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.0.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.1.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.2.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.3.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.4.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.4.1.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.5.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.6.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.7.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.8.0.tar.gz
ansible_collections/netapp/ontap/netapp-ontap-22.8.1.tar.gz
no changes added to commit (use "git add" and/or "git commit -a")
Are you able to cause the ppa process to rebuild, or are you able to contact the people who can?
@rit001 i'm not able to but i posted the same information in https://github.com/ansible-community/ppa/issues/77 so I'm hoping someone on their side can update it to the latest which should fix the issue.
I pushed the fix out and it on Galaxy.
https://galaxy.ansible.com/ui/repo/staging/netapp/ontap/?version=22.8.2
@carchi8py Hi, thank you for this. There is talk of cutting an Ansible 8.6.1 release to pick up this fix but 22.8.2 isn't tagged in the repository. Would you be able to create that?
@oraNod I'll have it tags in github once the change makes it thought our bitbucket pipeline (last steps is to push to githuib). Should be here with in the hour
Since it a super minor change i'm going to manually do it here and get the tag up (give me a few minutes)
Ok 22.8.2 release is on github
Thanks @carchi8py
Ansible 8.6.1 has been released. It contains the netapp.ontap 2.8.2 update that fixes this issue.
@carchi8py, firstly thanks for your help in getting this resolved.
Couple of questions since https://github.com/ansible-community/ppa/issues/77 is now closed:
apt-get update && apt-get install -y ansible \
|| ( \
# If the installation fails, apply the workaround:
# Comment out the first line of the na_ontap_s3_users.py script
# Failed to install Ansible, try workaround based on
# https://github.com/ansible-community/ppa/issues/77#issuecomment-1802847056
sed -i -e '1s/^[^#]*//' /usr/lib/python3/dist-packages/ansible_collections/netapp/ontap/plugins/modules/na_ontap_s3_users.py && \
# Then try to fix any broken dependencies
apt-get install -y --fix-broken \
)
- when will the apt repos get populated w/ 8.6.1?
On my systems (Debian-based, using the PPA), the error was gone as of today morning.
" * This software runs in various companies/enterprises. As such, it doesn't inspire confidence when a release contains an error which isn't even in source tree (indicates lack of centralized/controlled build system). Is there a github issue (or issue tracker) that we can follow to make sure that a centralized system for deploying updates is enforced (and that developers can't push out updates from arbitrary environments)?"
This was answered in
https://github.com/ansible-collections/netapp.ontap/issues/190
with the following statement from carchi8py
"I'll modify our internal pipeline to do a fresh git clone from now when building new releases."
This was fixed in 22.8.2
Summary
When installing either through the Ansible ppa package or the ansible-galaxy command, the
na_ontap_s3_users.py
file has the wordgit
before the shebang.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
ONTAP Collection Version
ONTAP Version
Playbook
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