- name: install dependencies
  yum:
    name: "{{ item }}"
  with_items:
    - bzip2
    - wget
    - gcc
  become: true

- name: download jemalloc
  get_url:
    url: "http://www.canonware.com/download/jemalloc/jemalloc-{{ jemalloc_version }}.tar.bz2"
    dest: "~/jemalloc-{{ jemalloc_version }}.tar.bz2"

- name: decompress jemalloc
  shell: "bzip2 -dc jemalloc-{{ jemalloc_version }}.tar.bz2 | tar xvf -"
  args:
    chdir: "~/"

- name: make jemalloc
  shell: |
    ./configure --disable-debug
    make
  args:
    chdir: "~/jemalloc-{{ jemalloc_version }}"

- name: install jemalloc
  shell: make install
  args:
    chdir: "~/jemalloc-{{ jemalloc_version }}"
  become: true

- name: use jemalloc
  lineinfile:
    dest: ~/.bash_profile
    line: "export LD_PRELOAD=\"/usr/local/lib/libjemalloc.so\""

- name: install dependencies
  yum:
    name: "{{ item }}"
  with_items:
    - bzip2
    - wget
    - gcc
  become: true

- name: download jemalloc
  get_url:
    url: "http://www.canonware.com/download/jemalloc/jemalloc-{{ jemalloc_version }}.tar.bz2"
    dest: "~/jemalloc-{{ jemalloc_version }}.tar.bz2"
  become: true

- name: decompress jemalloc
  shell: "bzip2 -dc jemalloc-{{ jemalloc_version }}.tar.bz2 | tar xvf -"
  args:
    chdir: "~/"
  become: true

- name: make jemalloc
  shell: |
    ./configure --disable-debug
    make
  args:
    chdir: "~/jemalloc-{{ jemalloc_version }}"
  become: true

- name: install jemalloc
  shell: make install
  args:
    chdir: "~/jemalloc-{{ jemalloc_version }}"
  become: true

- name: use jemalloc
  lineinfile:
    dest: ~/.bash_profile
    line: "export LD_PRELOAD=\"/usr/local/lib/libjemalloc.so\""

Use super user for jemalloc installation
Use super user for jemalloc installation
