---

- name: install lua packages
  apt:
    name: ['liblua5.1-0-dev', 'liblua50-dev', 'liblualib50-dev']
    state: present

- name: check out luasandbox from git
  git:
    repo=https://phabricator.wikimedia.org/diffusion/MLUS/php-luasandbox.git
    dest=/usr/src/luasandbox
    version=master

- name: compile and install luasandbox
  shell: phpize && ./configure --prefix=/usr/lib/php && make all install
  args:
    chdir: /usr/src/luasandbox

- name: copy luasandbox initialization file
  copy:
    src=luasandbox.ini
    dest=/etc/php/7.1/apache2/conf.d/20-luasandbox.ini
    mode=0600
    owner=root

---

- name: install lua packages
  apt:
    name: ['liblua5.1-0-dev', 'liblua50-dev', 'liblualib50-dev']
    state: present

- name: check out luasandbox from git
  git:
    repo=https://phabricator.wikimedia.org/diffusion/MLUS/php-luasandbox.git
    dest=/usr/src/luasandbox
    version=master

- name: compile and install luasandbox
  shell: phpize && ./configure --prefix=/usr/lib/php && make all install
  args:
    chdir: /usr/src/luasandbox

- name: copy luasandbox initialization file
  copy:
    src=luasandbox.ini
    dest="/etc/php/{{ php_debian_version }}/apache2/conf.d/20-luasandbox.ini"
    mode=0600
    owner=root

Make debian script independent of php version
Make debian script independent of php version
