]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
common: set apt pinning with Red Hat Ceph Storage
authorSébastien Han <seb@redhat.com>
Wed, 14 Dec 2016 17:15:02 +0000 (18:15 +0100)
committerSébastien Han <seb@redhat.com>
Wed, 14 Dec 2016 18:01:54 +0000 (19:01 +0100)
When `ceph_stable_rh_storage` is True, every cluster node should have a
`/etc/apt/preferences.d/rhcs.pref` file with the following contents:

```
Explanation: Prefer Red Hat packages
Package: *
Pin: release o=/Red Hat/
Pin-Priority: 999
```

ceph-deploy already did this when used with ice-setup, and we need to do
the same thing with the ceph-ansible stack.

Closes: #1182 and https://bugzilla.redhat.com/show_bug.cgi?id=1404515
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-common/tasks/installs/install_rh_storage_on_debian.yml
roles/ceph-common/templates/rhcs.pref.j2 [new file with mode: 0644]

index 8feabcb873705c752967656ddd5d52f2b19bf5fb..0f6f35aaa00eac3ff1efec071d34f333c39fcbf9 100644 (file)
     - ceph_rhcs
     - ceph_rhcs_iso_install
 
+- 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 the red hat storage apt-key
   apt_key:
     data: "{{ lookup('file', role_path+'/files/cephstablerhcs.asc') }}"
diff --git a/roles/ceph-common/templates/rhcs.pref.j2 b/roles/ceph-common/templates/rhcs.pref.j2
new file mode 100644 (file)
index 0000000..45abfbc
--- /dev/null
@@ -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