How can I use ansible to script eclipse installati

2019-07-14 06:07发布

问题:

I am an ansible newbee, so please forgive if this is obvious or well covered elsewhere.

I want to script the setup of a developer virtual machine using Vagrant. Part of the task is to install (simple) and configure eclipse (i.e. install plugins and features, import formatting settings and other workspace configurations etc. -- not so simple).

I could use the shell provisioner plus some scripts that automate the eclipse setup. Or I could try to use the ansible provisioner. Can ansible help me here? Are there any ansible modules that provide solutions for standard eclipse setup tasks?

Of course I could create a suitable eclipse installation manually and then pack and distribute that. In order to make this repeatable I would need to document all the steps and make sure that this documentation is complete. This is not what I want to do. I want to script the installation process so that it can be repeated and extended at any time.

回答1:

Instead of an external, generic tool like Ansible, you could use Eclipse Oomph to configure an Eclipse installation and workspace for the VMs. Oomph is the technology behind Eclipse's own installer, but it's designed to be a generic configuration management tool for any Eclipse-based "products." There's a learning curve, but one of Oomph's stated purposes is to support the situation you're facing. For starters, see the Oomph Authoring Guide.



回答2:

The following ansible role installs Eclipse + plugins: https://github.com/AlbanAndrieu/ansible-eclipse

The maintainer also provide a docker container to run the generated eclipse installation (without installing ansible locally).