diff --git a/defaults/main.yml b/defaults/main.yml index 5f1dd20..3bc5adb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,7 +9,7 @@ php_packages: - php7.0-fpm - php7.0-mysql - php7.0-gd - - php7.0-mbstring +# - php7.0-mbstring - php7.0-mcrypt php_timezone: Europe/Warsaw php_upload_max_filesize: "20M" diff --git a/tasks/main.yml b/tasks/main.yml index a6ffb39..564d046 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,20 +1,31 @@ --- -- name: Add PPA Repository - sudo: yes +- name: Add repository for Ubuntu + become: true apt_repository: repo={{ php_ppa }} + when: ansible_distribution|lower == "ubuntu" + +- name: Add repository for Debian + become: true + apt_repository: repo="deb http://packages.dotdeb.org {{ ansible_distribution_release }} all" state=present + when: ansible_distribution|lower == "debian" + +- name: Add apt key for Debian + become: true + apt_key: url=https://www.dotdeb.org/dotdeb.gpg state=present + when: ansible_distribution|lower == "debian" - name: Update apt - sudo: yes + become: yes apt: update_cache=yes - name: Install PHP - sudo: yes + become: yes apt: pkg=php7.0 state=latest - name: Install PHP Packages - sudo: yes + become: yes apt: pkg={{ item }} state=latest - with_items: php_packages + with_items: "{{ php_packages }}" when: php_packages is defined notify: - restart php7-fpm