diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 33e3fda..150b16a 100755 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -1,6 +1,6 @@ --- - hosts: all - sudo: true + become: yes vars_files: - vars/all.yml roles: @@ -9,3 +9,4 @@ - php - xdebug - app + - composer diff --git a/ansible/roles/app/tasks/main.yml b/ansible/roles/app/tasks/main.yml index c330e48..59e8b64 100755 --- a/ansible/roles/app/tasks/main.yml +++ b/ansible/roles/app/tasks/main.yml @@ -1,5 +1,4 @@ --- # application tasks to be customized and to run after the main provision - name: update file db - sudo: yes shell: updatedb diff --git a/ansible/roles/composer/tasks/main.yml b/ansible/roles/composer/tasks/main.yml new file mode 100644 index 0000000..27df507 --- /dev/null +++ b/ansible/roles/composer/tasks/main.yml @@ -0,0 +1,10 @@ +- name: Install Composer + shell: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer creates=/usr/local/bin/composer + +- name: Increase process timeout + shell: composer --global config process-timeout {{ composer.timeout }} + +- name: Install packages + shell: composer install --optimize-autoloader --prefer-source + args: + chdir: /vagrant \ No newline at end of file diff --git a/ansible/roles/php/tasks/main.yml b/ansible/roles/php/tasks/main.yml index b82c2f6..03fede2 100755 --- a/ansible/roles/php/tasks/main.yml +++ b/ansible/roles/php/tasks/main.yml @@ -1,20 +1,19 @@ --- +- name: Update apt + apt: update_cache=yes autoremove=yes + - name: Add ppa Repository - sudo: yes apt_repository: repo=ppa:ondrej/{{ php.ppa }} - name: Update apt - sudo: yes apt: update_cache=yes - name: Install php7 - sudo: yes apt: pkg=php7.0 state=latest - name: Install PHP Packages - sudo: yes - apt: pkg={{ item }} state=latest - with_items: php.packages + apt: pkg="{{ item }}" state=latest + with_items: "{{ php.packages }}" when: php.packages is defined - include: configure.yml diff --git a/ansible/roles/php/tasks/php-cli.yml b/ansible/roles/php/tasks/php-cli.yml index e1cfffa..ae079f2 100755 --- a/ansible/roles/php/tasks/php-cli.yml +++ b/ansible/roles/php/tasks/php-cli.yml @@ -1,10 +1,12 @@ --- -- name: ensure timezone is set in cli php.ini - lineinfile: dest=/etc/php5/cli/php.ini - regexp='date.timezone =' - line='date.timezone = {{ server.timezone }}' - - name: enabling opcache cli - lineinfile: dest=/etc/php5/cli/php.ini - regexp=';opcache.enable_cli=0' - line='opcache.enable_cli=1' + lineinfile: + dest: /etc/php/7.0/cli/php.ini + regexp: ';?opcache.enable=\d' + line: 'opcache.enable=1' + +- name: ensure timezone is set in cli php.ini + lineinfile: + dest: /etc/php/7.0/cli/php.ini + regexp: 'date.timezone =' + line: 'date.timezone = {{ server.timezone }}' \ No newline at end of file diff --git a/ansible/roles/server/tasks/main.yml b/ansible/roles/server/tasks/main.yml index f1ffc08..78efb9f 100755 --- a/ansible/roles/server/tasks/main.yml +++ b/ansible/roles/server/tasks/main.yml @@ -1,31 +1,25 @@ --- - name: Update apt - sudo: yes apt: update_cache=yes - name: Install System Packages - sudo: yes - apt: pkg={{ item }} state=latest + apt: pkg="{{ item }}" state=latest with_items: - curl - wget - python-software-properties - name: Install Extra Packages - sudo: yes - apt: pkg={{ item }} state=latest - with_items: server.packages + apt: pkg="{{ item }}" state=latest + with_items: "{{ server.packages }}" when: server.packages is defined - 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 diff --git a/ansible/roles/vagrant_local/tasks/main.yml b/ansible/roles/vagrant_local/tasks/main.yml index cd53609..70cad53 100755 --- a/ansible/roles/vagrant_local/tasks/main.yml +++ b/ansible/roles/vagrant_local/tasks/main.yml @@ -8,4 +8,10 @@ when: vagrant_local.vm.hostname is defined - name: Update /etc/hosts - lineinfile: dest=/etc/hosts regexp='^127\.0\.0\.1' line='127.0.0.1 localhost {{ vagrant_local.vm.hostname }}' owner=root group=root mode=0644 + lineinfile: + dest: /etc/hosts + regexp: '^127\.0\.0\.1' + line: '127.0.0.1 localhost {{ vagrant_local.vm.hostname }}' + owner: root + group: root + mode: 0644 diff --git a/ansible/roles/xdebug/tasks/main.yml b/ansible/roles/xdebug/tasks/main.yml index e38815d..380ee2b 100755 --- a/ansible/roles/xdebug/tasks/main.yml +++ b/ansible/roles/xdebug/tasks/main.yml @@ -1,4 +1,3 @@ --- - name: Install xDebug - sudo: yes apt: pkg=php5-xdebug state=latest diff --git a/ansible/vars/all.yml b/ansible/vars/all.yml index fe15f1e..25f56c7 100755 --- a/ansible/vars/all.yml +++ b/ansible/vars/all.yml @@ -1,15 +1,35 @@ --- server: install: '1' - packages: [vim, htop, iotop, bwm-ng] + packages: + - vim + - htop + - iotop + - bwm-ng + - git timezone: UTC locale: en_US.UTF-8 + vagrant_local: install: '1' - vm: { base_box: trusty64, hostname: design-patterns, ip: 192.168.11.2, sharedfolder: ./, enableWindows: '1', useVagrantCloud: '1', syncType: nfs } + vm: + hostname: design-patterns + php: install: '1' ppa: php - packages: [php7.0-cli, php7.0-intl, php7.0-mcrypt, php7.0-mysql, php7.0-curl, php7.0-json, php7.0-xml] + packages: + - php7.0-cli + - php7.0-intl + - php7.0-mcrypt + - php7.0-mysql + - php7.0-curl + - php7.0-json + - php7.0-xml + - php7.0-mbstring + xdebug: install: '1' + +composer: + timeout: 2400 \ No newline at end of file diff --git a/composer.lock b/composer.lock index 93cae18..da95186 100644 --- a/composer.lock +++ b/composer.lock @@ -211,16 +211,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "shasum": "" }, "require": { @@ -252,7 +252,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-06-10 09:48:41" + "time": "2016-09-30 07:12:33" }, { "name": "phpdocumentor/type-resolver",