Install and configures Apache Maven on RedHat/CentOS and Debian/Ubuntu.
- Ansible >=2.4
- EPEL Repo for RedHat/Centos, which can be installed automatically using the common ansible role.
- Java which can be installed using the skydevops-java
All the variable that can be overridden are stored in vars/main.yml or defaults/main.yml file as shown in the table below:
Name | Default Value | Description |
---|---|---|
main_rel |
: 3 | Major version of Maven |
min_rel |
: 5 | Minor version of Maven |
patch_rel |
: 3 | Patch version of Maven |
maven_version . |
: {{main_rel}}.{{min_rel}}.{{patch_rel}} | Maven Version that will be installed |
maven_install_dir |
: /apps | Install directory for maven |
maven_src_tar |
: apache-maven-{{maven_version}}-bin.zip | Apache Maven Archive |
maven_home |
: apache-maven-{{maven_version}} | M2_HOME ENV variable |
maven_shared_home |
: /usr/shared/maven | Symlink to the installed Maven |
maven_repo_dir |
: /data/maven/repo | Maven repo directory |
maven_profile_sh |
: /etc/profile.d/maven.sh | Jinja2 Template, contains the info to source the ENV variables |
- Ansible common Role, to install required directory structure and packages.
- Ansible java Role, which installs and configures java from Oracle.
# The defaults PATHS where Ansible looks for the files
When executing the playbook from the following path:
$ cd /home/${USER}/
$ ansible-playbook ${playbook_dir}/playbook.yml
/home/${USER}/roles/${ansible_role}/files/apache-maven-3.5.3-bin.zip
/home/${USER}/roles/${ansible_role}/apache-maven-3.5.3-bin.zip
/home/${USER}/roles/${ansible_role}/tasks/files/apache-maven-3.5.3-bin.zip
/home/${USER}/roles/${ansible_role}/tasks/apache-maven-3.5.3-bin.zip
/home/${USER}/${playbook_dir}/files/apache-maven-3.5.3-bin.zip
/home/${USER}/${playbook_dir}/apache-maven-3.5.3-bin.zip
- hosts: all
become: yes
gather_facts: yes
roles:
- role: 5KYDEV0P5.common
- hosts: testservers
become: yes
gather_facts: yes
roles:
- role: 5KYDEV0P5.skydevops-java
- role: 5KYDEV0P5.skydevops-maven
- Licensed under the Apache License V2.0.
- See the LICENSE file for details.
- You can find me on Twitter: @skydevops
- You can find me on Facebook: @skydevops
- Shashi Yebbare (@skydevops)