Role that installs the latest mono distribution.

This commit is contained in:
Andrea Dell'Amico 2019-03-20 19:11:14 +01:00
parent 7907003ec6
commit 2178279d06
2 changed files with 67 additions and 0 deletions

24
mono/defaults/main.yml Normal file
View File

@ -0,0 +1,24 @@
---
mono_repo_server: 'hkp://keyserver.ubuntu.com'
mono_deb_repo_key_id: 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
mono_deb_repo_url: 'deb https://download.mono-project.com/repo/{{ ansible_distribution | lower }} stable-{{ ansible_distribution_release }} main'
mono_rh_key: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'
mono_rh_repo_url: 'https://download.mono-project.com/repo/{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}-stable.repo'
mono_deb_prerequisites:
- apt-transport-https
- dirmngr
- gnupg
- ca-certificates
mono_deb_packages:
- mono-devel
- referenceassemblies-pcl
- mono-xsp4
mono_rh_packages:
- mono-devel
- referenceassemblies-pcl
- xsp

43
mono/tasks/main.yml Normal file
View File

@ -0,0 +1,43 @@
---
- block:
- name: Install the Mono dependencies on Deb based distributions
apt: name={{ mono_deb_prerequisites }} state=present cache_valid_time=1800
when: ansible_distribution_file_variety == "Debian"
tags: mono
- block:
- name: Install the deb Mono repository key
apt_key:
keyserver: {{ mono_repo_server }}
url: {{ mono_repo_server }}
id: {[ mono_deb_repo_key_id }}
- name: Install the deb Mono repository
apt_repository:
repo: '{{ mono_deb_repo_url }}'
state: present
update_cache: yes
- name: Install the Mono packages on Deb based distributions
apt: name={{ mono_deb_packages }} state=present cache_valid_time=1800
when: ansible_distribution_file_variety == "Debian"
tags: mono
- block:
- name: Install the RH Mono repository key
rpm_key:
state: present
key: {{ mono_rh_key }}
- name: Install the RH Mono repository
get_url:
dest: /etc/yum.repos.d/mono-{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}-stable.repo
url: {{ mono_rh_repo_url }}
- name: Install the Mono packages on RH based distributions
yum: name={{ mono_rh_packages }} state=present
when: ansible_distribution_file_variety != "Debian"
tags: mono