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.
pull/1379/head
Daniel Marks 2017-03-16 23:16:30 +01:00
parent d82ad7778d
commit 2ed94d914c
2 changed files with 9 additions and 11 deletions

View File

@ -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

View File

@ -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