Skip to content

Instantly share code, notes, and snippets.

@carlossg carlossg/Dockerfile
Created Dec 17, 2014

Embed
What would you like to do?
ansible maven
FROM ansible/centos7-ansible:stable
# or, for example, FROM ansible/ubuntu14.04-ansible:stable
RUN yum install -y tar
RUN ansible-galaxy install geerlingguy.java
RUN ansible-galaxy install https://github.com/silpion/ansible-maven.git
# Add playbooks to the Docker image
COPY site.yml /
# Run Ansible to configure the Docker image
RUN ansible-playbook site.yml -c local
COPY mvn.yml /
# cache Maven repo files
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:get || true
# The maven execution
RUN ansible-playbook -v mvn.yml -c local
- hosts: localhost
vars:
mvn_artifacts:
- id: org.apache.maven:maven-core:2.2.1:jar:sources
dest: /tmp/test.jar
# repos:
# - http://repo1.maven.apache.org/maven2
tasks:
- name: copy maven artifacts
command: mvn org.apache.maven.plugins:maven-dependency-plugin:get -Dartifact={{ item.id }} -Ddest={{ item.dest }} -Dtransitive=false -Pansible-maven -DremoteRepositories={{ item.repos | default(['http://repo1.maven.apache.org/maven2']) | join(",") }}
with_items: mvn_artifacts
register: mvn
- hosts: localhost
roles:
- { role: ansible-maven }
- { role: geerlingguy.java }
vars:
java_packages:
- java-1.7.0-openjdk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.