Skip to content

Commit

Permalink
Merge pull request #4 from ocha/update-package-to-latest-env
Browse files Browse the repository at this point in the history
Update package to latest env
  • Loading branch information
ocha authored May 3, 2018
2 parents 6d0e6be + 2a33d2c commit d191ede
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 59 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ env:
- distro: centos7
init: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: ubuntu1804
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: ubuntu1604
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: ubuntu1404
init: /sbin/init
run_opts: ""

# We need sudo for some of the Docker commands.
sudo: required
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Role Variables

Available variables are listed below, along with default values (see `defaults/main.yml`):

dotnet_rhel_package: "dotnet-sdk-2.0.0"
dotnet_ubuntu_package: "dotnet-sdk-2.0.0"
dotnet_package: "dotnet-sdk-2.1.105"
dotnet_debian_repo_gpg_key_url: "https://packages.microsoft.com/keys/microsoft.asc"

Generally, these should not be changed, but if this role is out of date, or if you need a very specific version, these can be overridden.

Expand Down
4 changes: 2 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
dotnet_rhel_package: "dotnet-sdk-2.0.0"
dotnet_ubuntu_package: "dotnet-sdk-2.0.0"
dotnet_package: "dotnet-sdk-2.1.105"
dotnet_debian_repo_gpg_key_url: "https://packages.microsoft.com/keys/microsoft.asc"
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
- name: EL
versions:
- 7
Expand Down
8 changes: 7 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
- include: rhel.yml
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' or ansible_distribution == 'RedHat' or ansible_distribution == 'Amazon'

- include: ubuntu.yml
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- name: Install dotnet core
package:
name: "{{ dotnet_package }}"
state: present
update_cache: true
29 changes: 4 additions & 25 deletions tasks/rhel.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
---
- name: .NET | Add rpm key
rpm_key:
key: https://packages.microsoft.com/keys/microsoft.asc
state: present
register: result
until: '"failed" not in result'
retries: 3
delay: 5

- name: .NET | Add YUM repository
- name: Add YUM repository
yum_repository:
name: packages-microsoft-com-prod
description: Microsoft .NET RHEL Repository
baseurl: https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod
enabled: yes
gpgcheck: yes
gpgkey: https://packages.microsoft.com/keys/microsoft.asc
enabled: yes
retries: 3
delay: 5
state: present

- name: .NET | Install dependencies
- name: Install dependencies
package:
name: "{{ item }}"
state: present
with_items:
- "libicu"
- "libunwind"

- name: .NET | Install dotnet core
package:
name: "{{ dotnet_rhel_package }}"
state: present
update_cache: true
register: result
until: '"failed" not in result'
retries: 3
delay: 5

39 changes: 14 additions & 25 deletions tasks/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
---
- name: .NET | Make sure HTTPS is supported by apt
package:
- name: Make sure HTTPS is supported by apt
apt:
name: apt-transport-https
state: present
update_cache: true
update_cache: yes

- name: .NET | Add apt key
- name: Import Microsoft APT key
apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc
url: "{{ dotnet_debian_repo_gpg_key_url }}"
state: present
register: result
until: '"failed" not in result'
retries: 3
delay: 5

- name: .NET | Add repo for Ubuntu Trusty
apt_repository:
repo: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
state: present
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "14"

- name: .NET | Add repo for Ubuntu Xenial
- name: Add repo for Ubuntu Xenial
apt_repository:
repo: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main
filename: "dotnetdev"
state: present
update_cache: yes
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16"

- name: .NET | Install dotnet core SDK
package:
name: "{{ dotnet_ubuntu_package }}"
- name: Add repo for Ubuntu Bionic
apt_repository:
repo: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main
filename: "dotnetdev"
state: present
update_cache: true
register: result
until: '"failed" not in result'
retries: 3
delay: 5

update_cache: yes
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "18"

0 comments on commit d191ede

Please sign in to comment.