Merge pull request #1186 from ceph/apt-pining

common: set apt pinning with Red Hat Ceph Storage
pull/1190/head
Sébastien Han 2016-12-15 12:28:45 +01:00 committed by GitHub
commit 245a556c5e
2 changed files with 21 additions and 10 deletions

View File

@ -3,15 +3,13 @@
# ISOs have MON, OSD, Tools, and Agent. If ISOs change the layout or provide # ISOs have MON, OSD, Tools, and Agent. If ISOs change the layout or provide
# certain repos depending on the type of node this task will require a more # certain repos depending on the type of node this task will require a more
# intelligent way to determine the location of the key. # intelligent way to determine the location of the key.
- name: install the rh ceph storage repository key - name: install the red hat ceph storage repository key
apt_key: apt_key:
file: "{{ ceph_rhcs_repository_path }}/MON/release.asc" file: "{{ ceph_rhcs_repository_path }}/MON/release.asc"
state: present state: present
when: when: ceph_rhcs_iso_install
- ceph_rhcs
- ceph_rhcs_iso_install
- name: add rh ceph storage repositories - name: add red hat ceph storage repositories
apt_repository: apt_repository:
repo: "deb file://{{ ceph_rhcs_repository_path }}/{{ item }}/ {{ ansible_lsb.codename }} main" repo: "deb file://{{ ceph_rhcs_repository_path }}/{{ item }}/ {{ ansible_lsb.codename }} main"
state: present state: present
@ -21,11 +19,17 @@
- "OSD" - "OSD"
- "Tools" - "Tools"
- "Agent" - "Agent"
when: when: ceph_rhcs_iso_install
- ceph_rhcs
- ceph_rhcs_iso_install
- name: add the red hat storage apt-key - name: set apt pinning for red hat ceph storage
template:
src: "{{ role_path }}/templates/rhcs.pref.j2"
dest: /etc/apt/preferences.d/rhcs.pref
owner: root
group: root
mode: 0644
- name: add red hat storage apt-key
apt_key: apt_key:
data: "{{ lookup('file', role_path+'/files/cephstablerhcs.asc') }}" data: "{{ lookup('file', role_path+'/files/cephstablerhcs.asc') }}"
state: present state: present
@ -81,7 +85,7 @@
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: client_group_name in group_names when: client_group_name in group_names
- name: install red hat storage NFS gateway - name: install red hat storage nfs gateway
apt: apt:
name: nfs-ganesha name: nfs-ganesha
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"

View File

@ -0,0 +1,7 @@
#jinja2: trim_blocks: "true", lstrip_blocks: "true"
# {{ ansible_managed }}
Explanation: Prefer Red Hat packages
Package: *
Pin: release o=/Red Hat/
Pin-Priority: 999