Skip to content

Instantly share code, notes, and snippets.

@jshirley
Created November 29, 2013 19:33
Show Gist options
  • Save jshirley/7710824 to your computer and use it in GitHub Desktop.
Save jshirley/7710824 to your computer and use it in GitHub Desktop.
Start of the plenv ansible gist that I'm using for TDP
---
- name: plenv | update plenv repo
git: repo=git://github.com/tokuhirom/plenv.git dest=$plenv_root
sudo: True
sudo_user: ${plenv_user}
- name: plenv | install perl-build
git: repo=git://github.com/tokuhirom/Perl-Build.git dest=/home/{{ plenv_user }}/.plenv/plugins/perl-build
sudo: True
sudo_user: ${plenv_user}
- name: plenv | add plenv initialization to profile
template: src=plenv.sh.j2 dest=/etc/profile.d/plenv.sh owner=root group=root mode=0755
- name: plenv | try to set global perl
shell: PLENV_ROOT=${plenv_root} PATH=${plenv_root}/bin:$PATH plenv global $perl_version chdir=$plenv_root
register: global_perl
ignore_errors: True
sudo: True
sudo_user: ${plenv_user}
- name: plenv | install perl
shell: PLENV_ROOT=${plenv_root} PATH=${plenv_root}/bin:$PATH plenv install $perl_version chdir=$plenv_root
when: global_perl|failed
sudo: True
sudo_user: ${plenv_user}
- name: plenv | try to set global perl
shell: PLENV_ROOT=${plenv_root} PATH=${plenv_root}/bin:$PATH plenv global $perl_version chdir=$plenv_root
sudo: True
sudo_user: ${plenv_user}
- name: plenv | install cpanm
shell: PLENV_ROOT=${plenv_root} PATH=${plenv_root}/bin:$PATH plenv install-cpanm chdir=$plenv_root
sudo: True
sudo_user: ${plenv_user}
- name: plenv | rehash
shell: PLENV_ROOT=${plenv_root} PATH=${plenv_root}/bin:$PATH plenv rehash chdir=$plenv_root
sudo: True
sudo_user: ${plenv_user}
export PLENV_ROOT="{{ plenv_root }}"
export PATH="{{ plenv_root }}/bin:$PATH"
eval "$(plenv init -)"
---
user: tdp
plenv_user: tdp
plenv_root: /home/tdp/.plenv
perl_version: 5.14.2
@kablamo
Copy link

kablamo commented Dec 1, 2013

Awesome thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment