add nexus module #45

Closed
wants to merge 5 commits into
from

Projects

None yet
@gregbuehler

This adds a module for pulling artifacts from a Nexus repository.

An example use case for deploying a snapshot artifact into Tomcat:

- name: Ensure foo application in container
  nexus:  server=nexus.example.com
          repository=example
          group=com.example.foo
          artifact=foo
          version=3.4.7-SNAPSHOT
          extension=war
          dest=/var/lib/tomcat6/webapps/foo.war
Greg Buehler add nexus module 4555dfa
@srvg
Member
srvg commented Oct 2, 2014

Do I see that right, there is no authentication to Nexus? I'm not sure how this would be useable?

@gregbuehler

I believe there is authentication, but it isn't required. I suppose it would be nice to have down the road. I haven't run into a use case where I've needed it yet. Here's a real example that actually gets a jar off the maven-central repository by proxy of jboss.org.

- name: test remote nexus by downloading xmlrpc-server.jar
      nexus:  server=repository.jboss.org
              repository=central
              group=xmlrpc
              artifact=xmlrpc-server
              version=3.0
              dest=~/xmlrpc-server.jar
@srvg
Member
srvg commented Oct 3, 2014

Oh, ok, for external access and such. When reading 'Nexus' I was thinking of SonayType Nexus, internally hosted. We use such an internal Nexus repository. Authentication is required.

@gregbuehler

@srvg: That's a good point. Do you know if the authentication is just http basic auth?

@srvg
Member
srvg commented Oct 3, 2014

AFAIK, yes. Now I fetch stuff with the uri or get_url module, before we dit a command: wget.
If you don't have a target to test your code, I'm happy to check that for you.

@dave-r12 dave-r12 commented on an outdated diff Nov 18, 2014
web_infrastructure/nexus.py
+ add_file_common_args=True
+ )
+
+ server = module.params['server']
+ repository = module.params['repository']
+ group = module.params['group']
+ artifact = module.params['artifact']
+ version = module.params['version']
+ packaging = module.params['packaging']
+ classifier = module.params['classifier']
+ extension = module.params['extension']
+ dest = os.path.expanduser(module.params['dest'])
+ timeout = module.params['timeout']
+
+ # assemble the url
+ url = "http://%s/nexus/service/local/artifact/maven/content?r=%s&g=%s&a=%s&v=%s" % ( server, repository, group, artifact, version )
@dave-r12
dave-r12 Nov 18, 2014

Is there a reason you use /nexus at the start of the path? We deploy our nexus at root context, so this URL won't work there

@mpdehaan mpdehaan added the new_module label Dec 8, 2014
@dave-r12

Hi, we've been using this module in our development environment for awhile now, and observed that our available disk space has continued to shrink upon successful deploys of our app. It looks like the module creates a temporary file, but does not remove it once it's been successfully copied to destination. Should the temporary file be removed once it's copied?

@jirutka
Contributor
jirutka commented Feb 15, 2015

FYI: There’s already a module for downloading artifacts and from any Maven repository, not just Nexus.
ansible/ansible#7630 and #243

@gregdek
Contributor
gregdek commented Jun 16, 2015

Thanks for submitting your module to Ansible Extras. Our policy is that each new module needs to be reviewed and approved by at least two official module reviewers, the list of whom can be found here: https://github.com/ansible/ansible-modules-extras/blob/devel/REVIEWERS.md

If you know someone on that list, please poke them and encourage them to review your module. :)

To ensure that your module has the best chance of being approved, please double-check that you adhere to the Ansible module guidelines: http://docs.ansible.com/developing_modules.html#module-checklist

@gregdek
Contributor
gregdek commented Aug 28, 2015

Hey @gregbuehler how's this module going?

@gregbuehler

I'm no longer with the organization that was using this, but I could give it a little love relatively soon.

@benkul is this still the same revision? Any bugs/updates I should be aware of?

@benkul
benkul commented Aug 28, 2015

@gregbuehler No bugs, no updates; we're still using it as written.

@gregbuehler

@gregdek I've pushed some revisions. My development workflow no longer includes Nexus, but @benkul, @srvg, or @dave-r12 might be able to verify the revisions.

@dave-r12

Thanks - we've been using this module in production for several months. We had applied 2 fixes (removing nexus context path and removing temp file) which are equivalent to the latest changes.

@robynbergeron
Contributor

Hi @gregbuehler -- Adding new process. We will be evaluating all new module PRs according to this process, effective immediately.

Btw: According to the new below process -- if @dave-r12, @srvg, @benkul (or anyone other caring user!) wishes to review this according to the guidelines below, we can get this on the road to merge more quickly. :D Thanks!

Thanks for submitting this new module to Ansible Extras! This module is now in community review, a process that is open to all Ansible users. In order for this module to be approved, it must gain the following votes:

“works_for_me”: If you have tested the module thoroughly, including testing of all of the module’s options, and if the module works for you, please add “works_for_me” in the comments.

“passes_guidelines”: If you have gone through the module guidelines and the module meets all of the requirements, please add “passes_guidelines” in the comments. Guidelines are available here: http://docs.ansible.com/developing_modules.html#module-checklist

“needs_revision”: If the module fails to work for you, or if it doesn’t meet guidelines, please add “needs_revision” in the comments with details about what needs to be fixed.

When a module has both “works_for_me” and “passes_guidelines” tags, we will promote the module for inclusion in Ansible Extras. At this point, you will be expected to maintain the module by fixing bugs and evaluating pull requests in a timely manner.

Thanks again for submitting your Ansible module!

@robynbergeron robynbergeron removed the P4 label Sep 25, 2015
@yuppie-flu
Contributor

Hi all! I believe you should close this request cause module for a maven artifact downloading already exists in 2.0: http://docs.ansible.com/ansible/maven_artifact_module.html

@gregbuehler

@yuppie-flu i concur!

@gregbuehler gregbuehler closed this Dec 1, 2015
@gregbuehler gregbuehler deleted the gregbuehler:nexus branch Dec 2, 2015
@aimonb aimonb added a commit to DimensionDataResearch/ansible-modules-extras that referenced this pull request Aug 12, 2016
@relaxdiego @aimonb relaxdiego + aimonb Allow the deletion of pools and members along with the load balancer (#…
…45)

LGTM. Thanks!
31d71af
@aimonb aimonb added a commit to DimensionDataResearch/ansible-modules-extras that referenced this pull request Aug 12, 2016
@aimonb aimonb Allow the deletion of pools and members along with the load balancer (#…
…45) (#46)

LGTM. Thanks!

Change-Id: Ic46dbc4ae1431a9ac882c88fbf0af56dd8b40d9a
b68e1f7
@aimonb aimonb added a commit to DimensionDataResearch/ansible-modules-extras that referenced this pull request Sep 8, 2016
@relaxdiego @aimonb relaxdiego + aimonb Allow the deletion of pools and members along with the load balancer (#…
…45)

LGTM. Thanks!
87e6f49
@relaxdiego relaxdiego added a commit to DimensionDataResearch/ansible-modules-extras that referenced this pull request Sep 15, 2016
@relaxdiego @relaxdiego relaxdiego + relaxdiego Allow the deletion of pools and members along with the load balancer (#…
…45)

LGTM. Thanks!
4ef502a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment