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

Enable apt pinning #81

Merged
Merged
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: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ mesos_version: "1.0.1"

# Debian
mesos_package_version: "2.0.93"
mesosphere_apt_url: "http://repos.mesosphere.com/{{ ansible_distribution | lower }}"
mesos_os_distribution: "{{ ansible_distribution | lower }}"
mesos_os_version: "{{ ansible_distribution_version.split('.') | join('') }}"
mesos_apt_package: "mesos={{ mesos_version }}-{{ mesos_package_version }}.{{ mesos_os_distribution }}{{ mesos_os_version }}"
mesos_apt_url: "http://{{ mesos_repo_host }}/{{ ansible_distribution | lower }}"
mesos_package_full_version: "{{ mesos_version }}-{{ mesos_package_version }}.{{ mesos_os_distribution }}{{ mesos_os_version }}"
mesos_apt_package: "mesos={{ mesos_package_full_version }}"

# RedHat: EPEL and Mesosphere yum repositories URL
epel_repo: "https://dl.fedoraproject.org/pub/epel/{{ os_version_major }}/{{ ansible_architecture }}/{{ epel_releases[os_version_major] }}"
Expand Down
11 changes: 7 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
mesos_install_mode: "master" # {master|slave|master-slave}
mesos_version: "1.1.0"

mesos_repo_host: repos.mesosphere.com

# Debian
mesos_package_version: "2.0.107"
mesosphere_apt_url: "http://repos.mesosphere.com/{{ ansible_distribution | lower }}"
mesos_os_distribution: "{{ ansible_distribution | lower }}"
mesos_os_version: "{{ ansible_distribution_version.split('.') | join('') }}"
mesos_apt_package: "mesos={{ mesos_version }}-{{ mesos_package_version }}.{{ mesos_os_distribution }}{{ mesos_os_version }}"
mesos_package_full_version: "{{ mesos_version }}-{{ mesos_package_version }}.{{ mesos_os_distribution }}{{ mesos_os_version }}"
mesosphere_apt_url: "http://{{ mesos_repo_host }}/{{ ansible_distribution | lower }}"
mesos_apt_package: "mesos={{ mesos_package_full_version }}"

# RedHat: EPEL and Mesosphere yum repositories URL
epel_repo: "https://dl.fedoraproject.org/pub/epel/{{ os_version_major }}/{{ ansible_architecture }}/{{ epel_releases[os_version_major] }}"
mesosphere_yum_repo: "https://repos.mesosphere.com/el/{{ os_version_major }}/noarch/RPMS/{{ mesosphere_releases[os_version_major] }}"
epel_repo: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ os_version_major }}.noarch.rpm"
mesosphere_yum_repo: "https://{{ mesos_repo_host }}/el/{{ os_version_major }}/noarch/RPMS/{{ mesosphere_releases[os_version_major] }}"

# conf file settings
mesos_cluster_name: "mesos_cluster"
Expand Down
6 changes: 6 additions & 0 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
- name: Add mesosphere repo
apt_repository: repo='deb {{ mesosphere_apt_url }} {{ ansible_distribution_release | lower }} main' state=present update_cache=yes

- name: Pin Mesos version
template:
src: mesos.pref.j2
dest: /etc/apt/preferences.d/mesos.pref
when: mesos_apt_pin_priority is defined

- name: Install Debian OS packages
apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600
with_items:
Expand Down
3 changes: 3 additions & 0 deletions templates/mesos.pref.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Package: mesos
Pin: version {{ mesos_package_full_version }}
Pin-Priority: {{ mesos_apt_pin_priority }}
5 changes: 0 additions & 5 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
os_version_major: "{{ ansible_distribution_major_version }}"

# EPEL repository released packaged per OS version
epel_releases:
'6': 'epel-release-6-8.noarch.rpm'
'7': 'e/epel-release-7-10.noarch.rpm'

# Mesosphere released packaged per OS version
mesosphere_releases:
'6': 'mesosphere-el-repo-6-3.noarch.rpm'
Expand Down