]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Configure pip to use our mirror in the common role
authorAndrew Schoen <aschoen@redhat.com>
Sun, 15 Mar 2015 18:20:30 +0000 (13:20 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 18 Mar 2015 14:15:18 +0000 (09:15 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/common/defaults/main.yml
roles/common/tasks/main.yml
roles/common/tasks/pip.yml [new file with mode: 0644]
roles/common/templates/pip.conf [new file with mode: 0644]

index 5c8966d290b1c94ad9084434ee916eb1b80aa470..44e69b086a17dda00f4386716462bcd1b3f66500 100644 (file)
@@ -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: ""
index f046a0df6eddb6b0938b0f366b2669919282237a..77614b5dfcc31062862147fe3b7f6bc118f564c5 100644 (file)
@@ -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 (file)
index 0000000..4aa70d0
--- /dev/null
@@ -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 (file)
index 0000000..c82ad50
--- /dev/null
@@ -0,0 +1,2 @@
+[global]
+index-url = {{ pip_mirror_url }}