From: Andrew Schoen Date: Sun, 15 Mar 2015 18:20:30 +0000 (-0500) Subject: Configure pip to use our mirror in the common role X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dd5d056d85be152d077adf80a4f3f4d459b1eec1;p=ceph-cm-ansible.git Configure pip to use our mirror in the common role Signed-off-by: Andrew Schoen --- diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml index 5c8966d..44e69b0 100644 --- a/roles/common/defaults/main.yml +++ b/roles/common/defaults/main.yml @@ -1,4 +1,6 @@ --- +pip_mirror_url: "http://apt-mirror.front.sepia.ceph.com/pypi/simple" + # these are encrypted in vars/redhat.yml subscription_manager_activationkey: "" subscription_manager_org: "" diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index f046a0d..77614b5 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,4 +1,7 @@ --- -# Setup/install tasks. - - include: setup-redhat.yml - when: ansible_os_family == 'RedHat' +# configure pip to use our mirror +- include: pip.yml + +# configure red hat specific things +- include: setup-redhat.yml + when: ansible_os_family == 'RedHat' diff --git a/roles/common/tasks/pip.yml b/roles/common/tasks/pip.yml new file mode 100644 index 0000000..4aa70d0 --- /dev/null +++ b/roles/common/tasks/pip.yml @@ -0,0 +1,16 @@ +--- +- name: Create /home/ubuntu/.pip + file: + path: /home/ubuntu/.pip + owner: ubuntu + group: ubuntu + mode: 0644 + state: directory + +- name: Create pip.conf and configure it to use our mirror + template: + src: pip.conf + dest: /home/ubuntu/.pip/pip.conf + owner: ubuntu + group: ubuntu + mode: 0644 diff --git a/roles/common/templates/pip.conf b/roles/common/templates/pip.conf new file mode 100644 index 0000000..c82ad50 --- /dev/null +++ b/roles/common/templates/pip.conf @@ -0,0 +1,2 @@ +[global] +index-url = {{ pip_mirror_url }}