]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Use ansible uri module instead of shell module with curl 1379/head
authorDaniel Marks <daniel.marks@codecentric.de>
Thu, 16 Mar 2017 22:16:30 +0000 (23:16 +0100)
committerDaniel Marks <daniel.marks@codecentric.de>
Thu, 16 Mar 2017 22:16:30 +0000 (23:16 +0100)
This fixes issue #1299. According to @ktdreyer s comment in the ticket,
he fixed the web server config so also older (non-SNI) python clients
can use the uri module here.

roles/ceph-common/tasks/installs/debian_ceph_repository.yml
roles/ceph-common/tasks/installs/redhat_ceph_repository.yml

index 00bedaafb28dcd16d43a55c61ff0297cc376afc4..45991f153cb9a1616aeabc6be90ffe53d19274a1 100644 (file)
   changed_when: false
   when: ceph_stable
 
-# we must use curl instead of ansible's uri module because SNI support in
-# Python is only available in 2.7.9 and later, and most supported distributions
-# don't have that version, so a request to https fails.
-- name : fetch ceph development repository sources list file
-  command: "curl -L https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_lsb.codename }}/repo"
+- name: fetch ceph development repository sources list file
+  uri:
+    url: https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_lsb.codename }}/repo
+    return_content: yes
   register: ceph_dev_deb_repo
   when: ceph_dev
 
 - name: add ceph development repository
   apt_repository:
-    repo: "{{ ceph_dev_deb_repo.stdout }}"
+    repo: "{{ ceph_dev_deb_repo.content }}"
     state: present
   changed_when: false
   when: ceph_dev
index b0f285b3e7277e5dc73252df579ed8fbc405caf4..4d8ea056ec083c732360d0bd1d649e2fcfe8e29a 100644 (file)
     baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/$basearch"
   when: ceph_stable
 
-# we must use curl instead of ansible's uri module because SNI support in
-# Python is only available in 2.7.9 and later, and most supported distributions
-# don't have that version, so a request to https fails.
 - name: fetch ceph development repo file
-  command: 'curl -L https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo'
+  uri:
+    url: https://shaman.ceph.com/api/repos/ceph/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo
+    return_content: yes
   register: ceph_dev_yum_repo
   when: ceph_dev
 
 - name: add ceph development repository
   copy:
-    content: "{{ ceph_dev_yum_repo.stdout }}"
+    content: "{{ ceph_dev_yum_repo.content }}"
     dest: /etc/yum.repos.d/ceph-dev.repo
     owner: root
     group: root