Skip to content
Snippets Groups Projects
mcrypt-7.2.yml 960 B
Newer Older
  • Learn to ignore specific revisions
  • jurgenhaas's avatar
    jurgenhaas committed
    ---
    # file: roles/php/tasks/mcrypt-7.2.yml
    
    - name: Check MCrypt Requirement
      stat:
        path: /usr/lib/php/20170718/mcrypt.so
      register: mcrypt_file
    
    - block:
    
        - name: Enable MCrypt for PHP
          copy:
            content: extension={{ item }}.so
            dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini
            owner: root
            group: root
            mode: 0644
          with_items:
            - mcrypt
    
        - name: Install packages
          apt:
            pkg: '{{ packages }}'
            state: present
            update_cache: yes
          vars:
            packages:
              - libmcrypt-dev
              - libreadline-dev
    
        - name: Install PECL packages
          shell: pecl install --soft --ignore-errors mcrypt-1.0.1
          when: php_version_main|default(7) == 7
          ignore_errors: yes
    
        - name: Enable extension
          shell: phpenmod {{ item }}
          with_items:
            - mcrypt
          notify:
            - Restart Apache
    
      when: not mcrypt_file.stat.exists