You can download and use the role here: https://github.com/litwicki/ansible-php7
roles/php7/tasks/main.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
--- - name: fix proxy for Ubuntu shell: sudo echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null - name: Update apt sudo: yes apt: update_cache=yes - name: Install System Packages sudo: yes apt: pkg={{ item }} state=latest with_items: - curl - wget - snmp - build-essential - python-software-properties - python-pip - python-dev - opensssl - libssl-dev - libcurl4-openssl-dev - pkg-config - name: Add repository for php7 shell: DEBIAN_FRONTEND=noninteractive sudo add-apt-repository -y ppa:ondrej/php-7.0 - name: Update apt sudo: yes apt: update_cache=yes - name: Purge php5 stuff shell: apt-get purge php5-fpm && sudo apt-get -y --purge autoremove - name: Install php7 Packages sudo: yes apt: pkg={{ item }} state=latest with_items: - php7.0-fpm - php7.0-cli - php7.0-curl - php7.0-common - php7.0-json - php7.0-opcache - php7.0-mysql - php7.0-phpdbg - php7.0-dbg - php7.0-gd - php7.0-imap - php7.0-ldap - php7.0-pgsql - php7.0-pspell - php7.0-recode - php7.0-snmp - php7.0-tidy - php7.0-dev - php7.0-intl - php7.0-gd - name: Install OAUTH PHP package sudo: yes shell: pecl install oauth - name: Configure the timezone sudo: yes template: src=timezone.tpl dest=/etc/timezone - name: More Configure the timezone sudo: yes file: src=/usr/share/zoneinfo/{{server.timezone}} dest=/etc/localtime state=link force=yes backup=yes - name: Set default system language pack shell: locale-gen {{server.locale}} sudo: yes |