Ansible role to install maven with yum

It should work on CentOS, Amazon Linux, etc.

– name: “Download maven”
get_url:
url: http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo
dest: /etc/yum.repos.d/epel-apache-maven.repo
validate_certs: no
timeout: 60
mode: 0777
register: apache-maven

– replace:
path: /etc/yum.repos.d/epel-apache-maven.repo
regexp: ‘\$releasever/’
replace: ‘6/’
backup: yes

– name: “Install dependencies”
yum:
name: “{{ item }}”
state: present
update_cache: yes
with_items:
– apache-maven

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: