Skip to content
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

support for mint #77

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Expand Up @@ -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
1 change: 1 addition & 0 deletions defaults/linuxmint.yml
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ oracle_java_version_string: "1.{{ oracle_java_version }}.0_{{ oracle_java_versio
oracle_java_ansible_arch_mappings:
x86_64: x64
i386: i586

# 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
Expand Up @@ -33,6 +33,10 @@ galaxy_info:
- vivid
- trusty
- precise
- name: Linuxmint
versions:
- sonya
- sylvia
galaxy_tags:
- development
- java
Expand Down
13 changes: 13 additions & 0 deletions tasks/check_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Up @@ -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'
Expand Down
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
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

- name: if debian, include family specific task file
include: "debian/main.yml"
when: ansible_os_family | lower == 'debian'
when: ansible_os_family | lower == 'debian' or ansible_os_family | lower == 'linuxmint'

- name: if redhat, include family specific task file
include: "redhat/main.yml"
Expand Down
13 changes: 13 additions & 0 deletions tests/boxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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