Test profile description
ijackua / try-yii2 Goto Github PK
View Code? Open in Web Editor NEWTry Yii2 with Vagrant VM + Ansible provisioning = Complete readymade virtual server playground
License: MIT License
Try Yii2 with Vagrant VM + Ansible provisioning = Complete readymade virtual server playground
License: MIT License
vagrant plugin install vagrant-hostsupdater vagrant-vbguest vagrant-cachier
vb.customize ["modifyvm", :id, "--cpus", "1" ]
must be by default, because it is minimal requirement and supported by all OSconfig.vm.network "private_network", ip: "192.168.33.33"
to more random 172.16.0.0 or 10.0.0.0 submaskOutput:
==> default: changed: [vagrant] => (item={'name': 'yii2.local', 'rootFolder': '/var/www/yii2-app-advanced/frontend/web'})
==> default: changed: [vagrant] => (item={'name': 'admin.yii2.local', 'rootFolder': '/var/www/yii2-app-advanced/backend/web'})
==> default: changed: [vagrant] => (item={'name': 'phpmyadmin.yii2.local', 'rootFolder': '/usr/share/phpmyadmin'})
==> default: changed: [vagrant] => (item={'name': 'adminer.yii2.local', 'rootFolder': '/usr/share/adminer'})
==> default:
==> default: TASK: [nginx | disable default site] ******************************************
==> default: changed: [vagrant]
==> default:
==> default: TASK: [nginx | disable default site] ******************************************
==> default: changed: [vagrant]
==> default:
==> default: TASK: [nginx | enable created sites] ******************************************
==> default: changed: [vagrant] => (item={'name': 'yii2.local', 'rootFolder': '/var/www/yii2-app-advanced/frontend/web'})
==> default: changed: [vagrant] => (item={'name': 'admin.yii2.local', 'rootFolder': '/var/www/yii2-app-advanced/backend/web'})
==> default: changed: [vagrant] => (item={'name': 'phpmyadmin.yii2.local', 'rootFolder': '/usr/share/phpmyadmin'})
==> default: changed: [vagrant] => (item={'name': 'adminer.yii2.local', 'rootFolder': '/usr/share/adminer'})
==> default:
==> default: TASK: [php | ensure PHP installed] ********************************************
==> default: changed: [vagrant] => (item=php5-fpm,php5-dev,php5-cli,php5-intl,php5-json,php5-pgsql,php5-mysql,php5-sqlite,php5-curl,php5-gd,php5-mcrypt,php5-xdebug,php5-memcached)
==> default:
==> default: TASK: [php | enable php modules] **********************************************
==> default: changed: [vagrant] => (item=mcrypt)
==> default:
==> default: TASK: [php | configure PHP settings] ******************************************
==> default: changed: [vagrant]
==> default:
==> default: TASK: [php | configure PHP-FPM Pool settings] *********************************
==> default: changed: [vagrant]
==> default:
==> default: TASK: [php | chown PHP-FPM sessions dir] **************************************
==> default: changed: [vagrant]
==> default:
==> default: TASK: [composer | download Composer] ******************************************
==> default: changed: [vagrant]
==> default:
==> default: TASK: [composer | install Composer globally] **********************************
==> default: changed: [vagrant]
==> default:
==> default: TASK: [composer | add GitHub Auth token] **************************************
==> default: skipping: [vagrant]
==> default:
==> default: TASK: [composer | install Composer Asset Plugin] ******************************
==> default: failed: [vagrant] => {"changed": true, "cmd": "composer global require 'fxp/composer-asset-plugin:1.0.0-beta4'", "delta": "0:00:07.165485", "end": "2015-12-08 16:32:31.353359", "rc": 255, "start": "2015-12-08 16:32:24.187874"}
==> default: stderr: You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
==> default: Changed current directory to /root/.composer
==> default: You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
==> default: ./co
==> default: mposer.json has been created
==> default: Loading composer repositories with package information
==> default: Updating dependencies (including require-dev)
==> default: - Installing fxp/composer-asset-plugin (v1.0.0-beta4)
==> default: Downloading: 100%
==> default:
==> default: PHP Fatal error: Call to undefined method Composer\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 270
==> default: PHP Stack trace:
==> default: PHP 1. {main}() /usr/local/bin/composer:0
==> default: PHP 2. require() /usr/local/bin/composer:25
==> default: PHP 3. Composer\Console\Application->run() phar:///usr/local/bin/composer/bin/composer:43
==> default: PHP 4. Symfony\Component\Console\Application->run() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
==> default: PHP 5. Composer\Console\Application->doRun() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:120
==> default: PHP 6. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
==> default: PHP 7. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:189
==> default: PHP 8. Composer\Command\GlobalCommand->run() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:838
==> default: PHP 9. Composer\Console\Application->run() phar:///usr/local/bin/composer/src/Composer/Command/GlobalCommand.php:80
==> default: PHP 10. Symfony\Component\Console\Application->run() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
==> default: PHP 11. Composer\Console\Application->doRun() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:120
==> default: PHP 12. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
==> default: PHP 13. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:189
==> default: PHP 14. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:838
==> default: PHP 15. Composer\Command\RequireCommand->execute() phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:256
==> default: PHP 16. Composer\Installer->run() phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:167
==> default: PHP 17. Composer\Installer->doInstall() phar:///usr/local/bin/composer/src/Composer/Installer.php:232
==> default: PHP 18. Composer\Installer\InstallationManager->execute() phar:///usr/local/bin/composer/src/Composer/Installer.php:604
==> default: PHP 19. Composer\Installer\InstallationManager->install() phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:139
==> default: PHP 20. Composer\Installer\PluginInstaller->install() phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:152
==> default: PHP 21. Composer\Plugin\PluginManager->registerPackage() phar:///usr/local/bin/composer/src/Composer/Installer/PluginInstaller.php:62
==> default: PHP 22. Composer\Plugin\PluginManager->addPlugin() phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php:158
==> default: PHP 23. Fxp\Composer\AssetPlugin\FxpAssetPlugin->activate() phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php:187
==> default: PHP 24. Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter->__construct() /root/.composer/vendor/fxp/composer-asset-plugin/FxpAssetPlugin.php:84
==> default: PHP 25. Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter->initialize() /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php:70
==> default: PHP 26. Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter->initInstalledPackages() /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php:243
==> default: stdout:
==> default: Fatal error: Call to undefined method Composer\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 270
==> default:
==> default: Call Stack:
==> default: 0.0001 224072 1. {main}() /usr/local/bin/composer:0
==> default: 0.0038 409440 2. require('phar:///usr/local/bin/composer/bin/composer') /usr/local/bin/composer:25
==> default: 0.0604 3791544 3. Co
==> default: mposer\Console\Application->run() phar:///usr/local/bin/composer/bin/composer:43
==> default: 0.0623 4148288 4. Symfony\Component\Console\Application->run() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
==> default: 0.0631 4285704 5. Composer\Console\Application->doRun() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:120
==> default: 0.0643 4399680 6. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
==> default: 0.0643 4400120 7. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:189
==> default: 0.0644 4400448 8. Composer\Command\GlobalCommand->run() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:838
==> default: 0.0660 4627584 9. Composer\Console\Application->run() phar:///usr/local/bin/composer/src/Composer/Command/GlobalCommand.php:80
==> default: 0.0660 4627584 10. Symfony\Component\Console\Application->run() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
==> default: 0.0661 4627808 11. Composer\Console\Application->doRun() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:120
==> default: 0.0664 4630024 12. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
==> default: 0.0664 4630024 13. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:189
==> default: 0.0664 4630528 14. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:838
==> default: 0.0669 4637048 15. Composer\Command\RequireCommand->execute() phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:256
==> default: 0.1249 9218384 16. Composer\Installer->run() phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:167
==> default: 0.1259 9202192 17. Composer\Installer->doInstall() phar:///usr/local/bin/composer/src/Composer/Installer.php:232
==> default: 5.0848 58382968 18. Composer\Installer\InstallationManager->execute() phar:///usr/local/bin/composer/src/Composer/Installer.php:604
==> default: 5.0848 58383112 19. Composer\Installer\InstallationManager->install() phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:139
==> default: 5.0848 58383536 20. Composer\Installer\PluginInstaller->install() phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:152
==> default: 7.1039 59006288 21. Composer\Plugin\PluginManager->registerPackage() phar:///usr/local/bin/composer/src/Composer/Installer/PluginInstaller.php:62
==> default: 7.1050 59072608 22. Composer\Plugin\PluginManager->addPlugin() phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php:158
==> default: 7.1050 59073200 23. Fxp\Composer\AssetPlugin\FxpAssetPlugin->activate() phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php:187
==> default: 7.1055 59134536 24. Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter->__construct() /root/.composer/vendor/fxp/composer-asset-plugin/FxpAssetPlugin.php:84
==> default: 7.1055 59134840 25. Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter->initialize() /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php:70
==> default: 7.1056 59135552 26. Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter->initInstalledPackages() /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php:243
==> default:
==> default: FATAL: all hosts have already failed -- aborting
==> default:
==> default: PLAY RECAP ********************************************************************
==> default: to retry, use: --limit @/root/main.retry
==> default:
==> default: vagrant : ok=21 changed=18 unreachable=0 failed=1
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
in provisioning/roles/composer/tasks/main.yml, I needed to change installing assets to:
- name: install Composer Asset Plugin
shell: "composer global require 'fxp/composer-asset-plugin:~1.1.1'"
One of my problems is the following:
==> default: TASK: [yii-advanced-project | clone advanced project temaplate] ***************
==> default: failed: [vagrant] => {"changed": true, "cmd": "composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced /var/www/yii2-app-advanced", "delta": "0:01:56.571960", "end": "2016-04-16 12:14:33.326671", "rc": 1, "start": "2016-04-16 12:12:36.754711"}
==> default: stderr: You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
==> default: Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
==> default: Installing yiisoft/yii2-app-advanced (dev-master 4504f1e4cbfb5df667eb9d1312cf11e8d7359c88)
==> default: - Installing yiisoft/yii2-app-advanced (dev-master master)
==> default: Downloading: 25%
==> Downloading: 100%
==> default:
==> default: Created project in /var/www/yii2-app-advanced
==> default: Loading composer repositories with package information
==> default: Updating dependencies (including require-dev)
==> default: Failed to clone the [email protected]:twitter/typeahead.js.git repository, try running in interactive mode so that you can enter your GitHub credentials
==> default:
==> default:
==> default: [RuntimeException]
==> default: Failed to execute git clone --mirror '[email protected]:twitter/typeahead.js.git' '/root/.cache/composer/vcs/git-github.com-twitter-typeahead.js.git/'
==> default:
==> default:
==> default: create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
==> default: stdout: Reading bower.json of bower-asset/jquery (2.1.2)
==> def
jquery (1.8.0)
==> default:
==> default: FATAL: all hosts have already failed -- aborting
==> default:
==> default: PLAY RECAP ********************************************************************
==> default: to retry, use: --limit @/root/main.retry
==> default:
==> default: vagrant : ok=50 changed=19 unreachable=0 failed=1
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
Does anyone have a solution?
vagrant up shws the following message:
==> default: TASK: [phpmongo | Download php_mongo] *****************************************
==> default: failed: [vagrant] => {"changed": true, "cmd": "wget https://github.com/mongodb/mongo-php-driver/archive/1.5.2.tar.gz", "delta": "0:00:00.947712", "end": "2016-04-16 11:33:05.273539", "rc": 8, "start": "2016-04-16 11:33:04.325827"}
==> default: stderr: --2016-04-16 11:33:04-- https://github.com/mongodb/mongo-php-driver/archive/1.5.2.tar.gz
==> default: Resolving github.com (github.com)... 192.30.252.129
==> default: Connecting to github.com (github.com)|192.30.252.129|:443... connected.
==> default: HTTP request sent, awaiting response... 302 Found
==> default: Location: https://codeload.github.com/mongodb/mongo-php-driver/tar.gz/1.5.2 [following]
==> default: --2016-04-16 11:33:04-- https://codeload.github.com/mongodb/mongo-php-driver/tar.gz/1.5.2
==> default: Resolving codeload.github.com (codeload.github.com)... 192.30.252.163
==> default: Connecting to codeload.github.com (codeload.github.com)|192.30.252.163|:443... connected.
==> default: HTTP request sent, awaiting response... 404 Not Found
==> default: 2016-04-16 11:33:05 ERROR 404: Not Found.
==> default:
==> default: FATAL: all hosts have already failed -- aborting
==> default:
==> default: PLAY RECAP ********************************************************************
==> default: to retry, use: --limit @/root/main.retry
==> default:
==> default: vagrant : ok=47 changed=17 unreachable=0 failed=1
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
it seems to me as if the correct mongo-php-driver is not found. Any suggestions how to solve the problem?
In turned out that the hosts file is marked executable on a Windows machine, which was making Ansible try to evaluate it as an external inventory script.
You could also add the provisioning folder in the Vagrantfile as follows:
config.vm.synced_folder './provisioning', '/vagrant/provisioning', mount_options: ["fmode=666"]
after
config.vm.synced_folder "./", "/var/www"
There is no progress looks like stuck in the middle of something
==> default: TASK: [phpredis | install PhpRedis for php lower than 5.5 (5.3 - 5.4)] ********
==> default: skipping: [vagrant]
==> default:
==> default: TASK: [redis | download Redis] ************************************************
==> default: skipping: [vagrant]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.