Skip to content

Splited debian/ubuntu and debian/mint tasks #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions defaults/debian.yml
Original file line number Diff line number Diff line change
@@ -11,3 +11,8 @@ oracle_java_home: "/usr/lib/jvm/java-{{ oracle_java_version }}-oracle"
oracle_java_os_supported: yes

oracle_java_state: latest

# codename hash to convert mint to ubuntu releases
oracle_java_ppa_mint:
sonya: xenial
sylvia: xenial
4 changes: 4 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -33,6 +33,10 @@ galaxy_info:
- vivid
- trusty
- precise
- name: Linuxmint
versions:
- sonya
- sylvia
galaxy_tags:
- development
- java
13 changes: 13 additions & 0 deletions tasks/check_environment.yml
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
# task to set host facts:
# - Java is installed?
# - which Java version is installed?
# - is ansible version correct ?
#

- name: determine if Java is already installed
@@ -39,3 +40,15 @@
- oracle_java_task_version
- oracle_java_version_installed
- oracle_java_version_string

# prior to 2.4, ansible facts for linux mint are:
# "ansible_os_family": "Linuxmint"
# "ansible_distribution": "Linuxmint"
# after 2.4, the facts change to something more sane
# "ansible_os_family": "Debian"
# "ansible_distribution": "Linux Mint"
- name: check ansible version
when: ansible_distribution == 'Linux Mint' or ansible_distribution == 'Linuxmint'
assert:
that: "ansible_version.full | version_compare('2.4', '>=')"
msg: "You must update Ansible to at least 2.4 to use this role with Linux Mint"
12 changes: 12 additions & 0 deletions tasks/debian/linuxmint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# file: oracle-java/tasks/debian/linuxmint.yml
#
# Task file to install Oracle Java Development Kit ppa for linux mint
#

- name: debian | mint | add java ppa repo
apt_repository:
repo=ppa:webupd8team/java
state=present
codename='{{ oracle_java_ppa_mint[ansible_lsb.codename] }}'
become: yes
28 changes: 2 additions & 26 deletions tasks/debian/main.yml
Original file line number Diff line number Diff line change
@@ -4,32 +4,8 @@
# Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution.
#

- name: debian | ubuntu | add java ppa repo
apt_repository:
repo=ppa:webupd8team/java
state=present
become: yes
when: ansible_distribution == 'Ubuntu'

- block:
- name: debian | ensure the webupd8 launchpad apt repository key is present
apt_key:
id=0xC2518248EEA14886
keyserver=keyserver.ubuntu.com
state=present
become: yes

- name: debian | ensure the webupd8 launchpad apt repository is present
apt_repository:
repo="{{ item }} http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main"
update_cache=yes
state=present
with_items:
- deb
- deb-src
become: yes

when: ansible_distribution == 'Debian'
# Linux mint reprts "ansible_distribution" as "Linux Mint", hence the whitespace trimming
- include: debian/{{ansible_distribution|lower|replace(' ', '') }}.yml

- name: debian | set license as accepted
debconf: name='oracle-java{{ oracle_java_version }}-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
11 changes: 11 additions & 0 deletions tasks/debian/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# file: oracle-java/tasks/debian/ubuntu.yml
#
# Task file to install Oracle Java Development Kit ppa for ubuntu
#

- name: debian | ubuntu | add java ppa repo
apt_repository:
repo=ppa:webupd8team/java
state=present
become: yes
12 changes: 12 additions & 0 deletions tasks/linuxmint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# file: oracle-java/tasks/debian/main.yml
#
# Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution.
#

- name: debian | mint | add java ppa repo
apt_repository:
repo=ppa:webupd8team/java
state=present
codename='{{ oracle_java_ppa_mint[ansible_lsb.codename]|default(ansible_lsb.codename) }}'
become: yes
13 changes: 13 additions & 0 deletions tests/boxes.yml
Original file line number Diff line number Diff line change
@@ -109,3 +109,16 @@ vagrant:
memory: 1024
cpus: 1

# Linux mint

mint_sylvia64.vagrant.dev:
enabled: true
box: ajxb/mint-18.3
network:
name: private_network
ip: 192.168.124.14

provider:
virtualbox:
memory: 1024
cpus: 1
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
test_java_version: 8
test_java_version_update: 112
test_java_version_build: 15
test_latest_java_version_update: 144
test_latest_java_version_update: 151
test_latest_java_version_build: 13

roles: