Archive for September, 2017

Ansible role to install maven with yum

September 8, 2017

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