diff --git a/roles/bootstrap-os/tasks/bootstrap-centos.yml b/roles/bootstrap-os/tasks/bootstrap-centos.yml
index 07a555c14250e0a24fafd4f5cec82d4ace8f4303..142842b8eaf5ab2bf2cb443ee62d68cdd23c4a55 100644
--- a/roles/bootstrap-os/tasks/bootstrap-centos.yml
+++ b/roles/bootstrap-os/tasks/bootstrap-centos.yml
@@ -14,6 +14,14 @@
     state: present
   when: fastestmirror.stat.exists
 
+- name: Add proxy to /etc/yum.conf if http_proxy is defined
+  lineinfile:
+    path: "/etc/yum.conf"
+    line: "proxy={{http_proxy}}"
+    create: yes
+    state: present
+  when: http_proxy is defined
+
 - name: Install packages requirements for bootstrap
   yum:
     name: "{{ packages }}"
@@ -27,4 +35,3 @@
   yum:
     name: python-pip
     state: present
-  environment: "{{proxy_env}}"