From cd40893e35ffa08d32c8ee2af000c18e9f081811 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Mon, 22 May 2017 10:36:33 +0300 Subject: [PATCH] - Forked from the php5 role. --- .travis.yml | 8 ++++---- README.rst | 8 ++++---- defaults/main.yml | 2 +- handlers/main.yml | 2 +- meta/main.yml | 8 +++----- molecule.yml | 2 +- tasks/main.yml | 14 +++++++------- tests/playbook.yml | 6 +++--- tests/{test_php5.py => test_php7.py} | 8 ++++---- tox.ini | 2 +- vars/main.yml | 2 +- 11 files changed, 30 insertions(+), 32 deletions(-) rename tests/{test_php5.py => test_php7.py} (74%) diff --git a/.travis.yml b/.travis.yml index d32f5f7..feaf754 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,10 +10,8 @@ env: - VBOX_HWVIRTEX=off matrix: - TOXENV=openbsd60 - - TOXENV=trusty - - TOXENV=precise - - &jessie TOXENV=jessie - - TOXENV=wheezy + - TOXENV=xenial + - &stretch TOXENV=stretch cache: - pip @@ -37,6 +35,8 @@ notifications: matrix: fast_finish: True + allow_failures: + - env: *stretch include: - env: TOXENV: pre-commit diff --git a/README.rst b/README.rst index b22dcbc..28d3680 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,10 @@ -PHP5 +PHP7 #### -.. image:: https://travis-ci.org/adarnimrod/php5.svg?branch=master - :target: https://travis-ci.org/adarnimrod/php5 +.. image:: https://travis-ci.org/adarnimrod/php7.svg?branch=master + :target: https://travis-ci.org/adarnimrod/php7 -Install PHP5 (cli, not mod-php nor fpm). +Install PHP7 (cli, not mod-php nor fpm). Requirements ------------ diff --git a/defaults/main.yml b/defaults/main.yml index 2ded7be..76770b4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,2 @@ --- -# defaults file for php5 +# defaults file for php7 diff --git a/handlers/main.yml b/handlers/main.yml index 21fe594..ee1aa0a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,2 +1,2 @@ --- -# handlers file for php5 +# handlers file for php7 diff --git a/meta/main.yml b/meta/main.yml index 73fa8e3..e5ca1dd 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,20 +1,18 @@ galaxy_info: author: Nimrod Adar - description: Install PHP5 (cli, not mod-php nor fpm) + description: Install PHP7 (cli, not mod-php nor fpm) company: Shore technologies license: MIT min_ansible_version: 2.3 platforms: - name: Debian versions: - - jessie - - wheezy + - stretch - name: OpenBSD versions: - 6.0 - name: Ubuntu versions: - - trusty - - precise + - xenial galaxy_tags: [ php ] dependencies: [] diff --git a/molecule.yml b/molecule.yml index 4e74eae..fefcff4 100644 --- a/molecule.yml +++ b/molecule.yml @@ -35,7 +35,7 @@ vagrant: - name: wheezy box: bmorg/debian-wheezy-i386 instances: - - name: php5 + - name: php7 options: append_platform_to_hostname: yes raw_config_args: diff --git a/tasks/main.yml b/tasks/main.yml index 0266348..35f7b16 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,5 @@ --- -# tasks file for php5 +# tasks file for php7 - name: Assertions assert: that: @@ -8,7 +8,7 @@ - name: APT install when: ansible_pkg_mgr == 'apt' apt: - name: ['php-pear', 'php5-dev', 'php5-cli', 'cron'] + name: ['php-pear', 'php7.0-dev', 'php7.0-cli', 'cron'] state: present update_cache: yes cache_valid_time: 3600 @@ -19,11 +19,11 @@ name: pear state: present -- name: Create php5 symlink +- name: Create php7 symlink when: ansible_pkg_mgr == 'openbsd_pkg' - with_items: ['php', 'php5'] + with_items: ['php', 'php7'] file: - src: /usr/local/bin/php-5.6 + src: /usr/local/bin/php-7.0 dest: '/usr/local/bin/{{ item }}' owner: root group: 0 @@ -36,7 +36,7 @@ 'allow_url_fopen': 'On' 'suhosin.executor.include.whitelist': 'phar' ini_file: - dest: /etc/php-5.6.ini + dest: /etc/php-7.0.ini section: PHP option: '{{ item.key }}' value: '{{ item.value }}' @@ -47,7 +47,7 @@ dest: /root/composer-install - name: Install Composer - command: php5 -f /root/composer-install -- --install-dir=/usr/local/bin --filename=composer + command: php7 -f /root/composer-install -- --install-dir=/usr/local/bin --filename=composer args: creates: /usr/local/bin/composer diff --git a/tests/playbook.yml b/tests/playbook.yml index 94db4a5..fa483a9 100644 --- a/tests/playbook.yml +++ b/tests/playbook.yml @@ -1,5 +1,5 @@ --- -- hosts: php5-openbsd* +- hosts: php7-openbsd* gather_facts: false roles: - openbsd-bootstrap @@ -8,7 +8,7 @@ users_use_sudo: True users_lock_root_ssh: False -- hosts: [php5-xenial, php5-wheezy] +- hosts: [php7-xenial, php7-wheezy] gather_facts: false roles: - debian-bootstrap @@ -19,4 +19,4 @@ - hosts: all roles: - - role: php5 + - role: php7 diff --git a/tests/test_php5.py b/tests/test_php7.py similarity index 74% rename from tests/test_php5.py rename to tests/test_php7.py index 2c82b53..15d3302 100644 --- a/tests/test_php5.py +++ b/tests/test_php7.py @@ -3,8 +3,8 @@ from testinfra.utils.ansible_runner import AnsibleRunner testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') -def test_php5(Command): - assert Command('php5 --version').stdout.startswith('PHP 5') +def test_php7(Command): + assert Command('php7 --version').stdout.startswith('PHP 7') def test_composer(Command): @@ -16,8 +16,8 @@ def test_pear(Command): def test_php_ini(Command): - command = Command('php5 --info') + command = Command('php7 --info') assert command.rc == 0 - assert 'PHP Version => 5' in command.stdout + assert 'PHP Version => 7' in command.stdout assert 'syntax error' not in command.stdout assert 'syntax error' not in command.stderr diff --git a/tox.ini b/tox.ini index 09d79c0..8585b01 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] skip_install = True skipsdist = True -envlist = openbsd60,trusty,precise,jessie,wheezy +envlist = openbsd60,xenial,stretch [testenv] envdir = {toxinidir}/.tox/molecule diff --git a/vars/main.yml b/vars/main.yml index 4e74b4e..204dcce 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,2 +1,2 @@ --- -# vars file for php5 +# vars file for php7 -- GitLab