From 2ed94d914c3912031ca65e98cb5c6ae8ce0c5658 Mon Sep 17 00:00:00 2001 From: Daniel Marks Date: Thu, 16 Mar 2017 23:16:30 +0100 Subject: [PATCH] Use ansible uri module instead of shell module with curl 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. --- .../tasks/installs/debian_ceph_repository.yml | 11 +++++------ .../tasks/installs/redhat_ceph_repository.yml | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/roles/ceph-common/tasks/installs/debian_ceph_repository.yml b/roles/ceph-common/tasks/installs/debian_ceph_repository.yml index 00bedaafb..45991f153 100644 --- a/roles/ceph-common/tasks/installs/debian_ceph_repository.yml +++ b/roles/ceph-common/tasks/installs/debian_ceph_repository.yml @@ -18,17 +18,16 @@ 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 diff --git a/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml b/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml index b0f285b3e..4d8ea056e 100644 --- a/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml @@ -15,17 +15,16 @@ 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