• About
  • Manuals
  • Network
Confessions of a FreeBSD hacker Various tips & tricks about computers in general and FreeBSD in particular
Confessions of a FreeBSD hacker

Ansible playbook for handling perl on FreeBSD

July 23, 2017 16:59 / Leave a Comment / Magnus Strahlert

Starting with Perl 5.20 the symlink in /usr/bin/perl has been removed. This playbook remedies that.

---
- name: Check if perl is installed
  register: perl_installed
  stat:
    path: /usr/local/bin/perl

- name: Check perl version
  register: perl_version
  command: /usr/local/bin/perl -v
  changed_when: false
  when: perl_installed.stat.exists

#- name: Check perl version (debug)
#  debug:
#    msg: "{{ perl_installed.stat.exists }}"

- name: Add symlink for perl
  file:
    src: /usr/local/bin/perl
    dest: /usr/bin/perl
    state: link
  when:
    - perl_installed.stat.exists
    - perl_version.stdout | regex_replace('(?s).*This is perl (?P<mainver>\\d+), version (?P<ver>\\d+), subversion.*', '\\g<ver>') >= "20"

#- name: Check version
#  debug:
#    msg: "{{ perl_version.stdout | regex_replace('(?s).*This is perl (?P<mainver>\\d+), version (?P<ver>\\d+), subversion.*', '\\g<mainver>.\\g<ver>') }}"
Posted in: FreeBSD / Tagged: ansible, freebsd

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *

Post Navigation

← Previous Post
Next Post →

Recent Posts

  • Takeaways utilising VFIO in a KVM virtual guest
  • Converting VM from ESXi to KVM with iSCSI storage
  • Deploying oVirt in self-hosted mode
  • Ansible playbook for handling perl on FreeBSD
  • iSCSI: Migrating from istgt to ctld

Tags

ansible backup carp chroot cluster cross-server esxi freebsd ftp ftpchroot gpt grub hast install iscsi kvm linux lun lvm mirror network nfs nfsroot ovirt pxe raid ramdrive raspberrypi snapshot ssd ssh terminalserver usb vfio virtio virtualbox vlan vmware volumes winxp zfs zpool zroot

Archives

  • July 2019
  • March 2018
  • February 2018
  • July 2017
  • February 2016
  • January 2015
  • August 2014
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • September 2012
  • July 2012
  • April 2012
  • March 2012
  • November 2011
  • August 2011

Recent Comments

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    © Copyright 2013-2016 - Magnus Strahlert
    Infinity Theme by DesignCoral / WordPress