Phansible - generate Vagrant + Ansible dev environments for PHP

Overview

Phansible

Build Status Scrutinizer Code Quality Code Coverage License

Phansible is a simple generator for Vagrant projects, targeting PHP development environments, using Ansible as Provisioner.

It was inspired by PuPHPet.

The project is built on top of Silex, using Flint.

Contributions

Contributions are always welcome, please have a look at our issues to see if there's something you could help with. You can also join us on gitter.

TO DO

  • Deprecate 1.0 branch and put master into production
  • CI our generated roles (@naxhh is working on this)
  • API for generating roles outside the Web (@erikaheidi is working on this)
  • New technologies (request for your favourite ones!)
  • More documentation on how to customize things
  • Take a look at our issues.

Setup

  • Clone the repo: git clone https://github.com/Phansible/phansible.git
  • Go into the phansible folder cd phansible/
  • Install the dependencies with composer: php composer install
  • Run the php built in server: php -S 0.0.0.0:8080 -t web/
  • You can now go on http://localhost:8080 to see your modification.

As an alternative, you can also use the included Vagrant setup (requires Ansible).

Tests

To run the tests just do:

 ./vendor/bin/phpunit

Code style

To check the code style just do:

 ./vendor/bin/phpcs --standard=psr2 ./src
 ./vendor/bin/phpmd src/ text codesize,controversial,design,naming,unusedcode

When no errors appear you are ready to push your commits!

Issues
  • PHP 7.0 support

    PHP 7.0 support

    Issue #250, relative pull requests: phansible/role-php#7, phansible/role-nginx#3

    issue/WIP 
    opened by popstas 36
  • Phpmyadmin

    Phpmyadmin

    Adding phpmyadmin as an option when the database is selected.

    Any comment ?

    opened by mikeSimonson 33
  • Proposal to move code from the bundle controller to separate roles.

    Proposal to move code from the bundle controller to separate roles.

    Here is my small and simple proposal to move the setup function to separate roles. Each ansible role should have it's own php class to setup the correct vars that are needed for this role. This way the bundle controller will become tiny again :)

    PS: didn't fix the tests yet, since it was just a PR to discuss :)

    opened by sndpl 26
  • UI from Phpansible

    UI from Phpansible

    Merging the UI from Phpansible in order to merge the projects.

    Phpansible UI has a lot more options, but we focused only on the ones Phansible already has.

    opened by InFog 24
  • Not sure why php is not getting installed.

    Not sure why php is not getting installed.

    Hi,

    In order to save the time/bandwidth I downloaded a box from https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box and used to change the config.vm.box = "file:///home/hari/Downloads/virtualbox.box". It can download easily. A few errors I noticed seems not respect to box, may be you can help with . Same is happening with @puphpet . See issue https://github.com/puphpet/puphpet/issues/1224

    ==> default: cp: 
    ==> default: cannot stat ‘/vagrant/ansible/inventories/dev’
    ==> default: : No such file or directory
    ==> default: cat: 
    ==> default: /vagrant/ansible/files/authorized_keys
    ==> default: : No such file or directory
    ==> default: ERROR: the playbook: /vagrant/ansible/playbook.yml could not be found
    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.
    \w > \[email protected]\h [php:5.5.9-system]\n$ ls
    ansible  Vagrantfile
    \w > \[email protected]\h [php:5.5.9-system]\n$ vagrant status
    /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/lib/vagrant/pre-rubygems.rb:31: warning: Insecure world writable dir /var/www in PATH, mode 040777
    /opt/vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /var/www in PATH, mode 040777
    Current machine states:
    
    default                   running (virtualbox)
    
    The VM is running. To stop this VM, you can run `vagrant halt` to
    shut it down forcefully, or you can run `vagrant suspend` to simply
    suspend the virtual machine. In either case, to restart it again,
    simply run `vagrant up`.
    \w > \[email protected]\h [php:5.5.9-system]\n$ vagrant ssh
    /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/lib/vagrant/pre-rubygems.rb:31: warning: Insecure world writable dir /var/www in PATH, mode 040777
    /opt/vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /var/www in PATH, mode 040777
    Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-40-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com/
    
      System information as of Thu Nov 27 01:17:53 UTC 2014
    
      System load:  0.37              Processes:           86
      Usage of /:   2.7% of 39.34GB   Users logged in:     0
      Memory usage: 16%               IP address for eth0: 10.0.2.15
      Swap usage:   0%
    
      Graph this data and manage this system at:
        https://landscape.canonical.com/
    
      Get cloud support with Ubuntu Advantage Cloud Guest:
        http://www.ubuntu.com/business/services/cloud
    
    0 packages can be updated.
    0 updates are security updates.
    
    
    [email protected]:~$ php -v
    The program 'php' is currently not installed. To run 'php' please ask your administrator to install the package 'php5-cli'
    
    opened by harikt 21
  • Error when attempting to run vagrant up for the first time

    Error when attempting to run vagrant up for the first time

    ERROR: The file ansible/inventories/dev is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with chmod -x ansible/inventories/dev. Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.

    opened by thecrimpmaster 18
  • [RFC] Resolve #187

    [RFC] Resolve #187

    This PR address the issue #187

    The main changes were done on each relational database[1] YAML file and its TWIG template respectively

    The dump file must remain at the root level[2]

    [1] MySQL, MariaDB, PostgreSQL [2] /path/to/your/extracted_phansible/your_sql.sql

    opened by kinncj 17
  • support for blackfire.io

    support for blackfire.io

    The PR adds support for blackfire.io code analysis service. In the form you can provide server id and token that are necessary for the profiler to work.

    opened by leafnode 16
  • Solr download url 404

    Solr download url 404

    The URL to download solr (5.2.0, or 5.3.0 tested) isn't working.

    TASK: [solr | Download] ******************************************************* 
    failed: [192.168.33.99] => {"dest": "/tmp", "failed": true, "gid": 0, "group": "root", "mode": "01777", "owner": "root", "response": "HTTP Error 404: Not Found", "size": 4096, "state": "directory", "status_code": 404, "uid": 0, "url": "http://mirrors.supportex.net/apache//solr-5.2.0.tgz"}
    msg: Request failed
    
    FATAL: all hosts have already failed -- aborting
    
    opened by spoetnik 16
  • Hostname is not defined.

    Hostname is not defined.

    I've an error when running a default generated playbook using Vagrant in windows.

    The error is:

    ==> default: TASK: [init | Update /etc/hosts] **********************************************
    ==> default: fatal: [192.168.33.99] => One or more undefined variables: 'hostname' is undefined
    

    You can check the full log: http://pastebin.com/xgSLExX3

    Checking for #110 I've found this error.

    Seems that this hostname is added in the Vagrant file.

    Debugging the content returns:

    ==> default: ok: [192.168.33.99] => {
    ==> default:     "hostname": "{{ hostname }}"
    ==> default: }
    
    bug 
    opened by naxhh 14
  • Incorrect PHP version in PHP-FPM

    Incorrect PHP version in PHP-FPM

    Utilizing Phansible I've managed to fix all the bugs to bring up a LEMP stack properly.

    I have ran php -v and 5.6.30 for CLI is installed. However when I ran through the forward nginx web - I am getting errors. With phpinfo(); from the web I have discovered that php5-fpm is set and that is on native ubuntu 5.5.9.

    PHP 5.6 did get installed under /usr/sbin/php-fpm5.6 however. How do i get the correct version of PHP installed both for CLI (currently working) and fpm (currently not work) within ansible playbook rather than copying files over since I have to distribute this vagrant ansible setup across projects.

    opened by beerbuddha 0
  • ondrej/php5 no longer available

    ondrej/php5 no longer available

    I've just tried to boot up a newly configured box, and been told that the PPA could not be found.

    Digging in to the PHP role it was using ondrej/php5 as the PPA. It looks like this was previously deprecated, and therefore may have been removed.

    I've changed to ondrej/php, and everything seems to have worked OK, so think that this might need updating.

    opened by toby-griffiths 0
  •  vagrant up : No package matching 'server.packages' is available

    vagrant up : No package matching 'server.packages' is available

    • I used http://phansible.com/ to generate https://file.io/v3TnEr
    • when run vagrant up it gives "No package matching 'server.packages' is available" (log : https://pastebin.mozilla.org/8954010)
    • non of packages I've selected has been installed.

    I am using windows and hosts file has been updated. Anything has to be changed?

    opened by dumindu 7
  • Errors on Vagrant Up...

    Errors on Vagrant Up...

    Suddenly started getting errors on booting up VMs: changed overnight with no changes in my local environment. The error message has changed (which again suggests it's not a local issue), but It seems to be to do with loading PHP. Any ideas? Thanks in advance for your help!

    Here's the tail end of the log:

    ==> default: TASK [php : Add ppa Repository] ************************************************ ==> default: fatal: [192.168.33.99]: FAILED! => {"changed": false, "failed": true, "msg": "failed to fetch PPA information, error was: HTTP Error 404: Not Found"} ==> default: ==> default: RUNNING HANDLER [apache : restart apache] ************************************** ==> default: to retry, use: --limit @/vagrant/ansible/playbook.retry ==> default: ==> default: PLAY RECAP ********************************************************************* ==> default: 192.168.33.99 : ok=20 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.

    opened by JimPirrie 12
  • Getting errors on vagrant up

    Getting errors on vagrant up

    Hi, Trying to run a box and after vagrant up I'm getting the following errors:

    ....
    ==> default: stdin: is not a tty
    ....
    ==> default: gpg:
    ==> default: keyring `/tmp/tmprfhgdqk1/secring.gpg' created
    ==> default: gpg:
    ==> default: keyring `/tmp/tmprfhgdqk1/pubring.gpg' created
    ==> default: gpg:
    ==> default: requesting key 7BB9C367 from hkp server keyserver.ubuntu.com
    ==> default: gpg:
    ==> default: /tmp/tmprfhgdqk1/trustdb.gpg: trustdb created
    ==> default: gpg:
    ==> default: key 7BB9C367: public key "Launchpad PPA for Ansible, Inc." imported
    ==> default: gpg:
    ==> default: Total number processed: 1
    ==> default: gpg:
    ==> default:               imported: 1
    ==> default:   (RSA: 1)
    ....
    ==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory
    ....
    ==> default: cp:
    ==> default: cannot stat ‘/vagrant/ansible/inventories/dev’
    ==> default: : No such file or directory
    ==> default: cat:
    ==> default: /vagrant/ansible/files/authorized_keys
    ==> default: : No such file or directory
    ==> default: ERROR! the playbook: /vagrant/ansible/playbook.yml could not be found
    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.
    

    I usually used already pre-made vagrant boxes before and creating my own for the first time.

    bug 
    opened by vatnoise 10
  • Multiple Apache Virtualhosts

    Multiple Apache Virtualhosts

    Hi awesome dev

    I'd really like phansible to support multiple Apache VirtualHosts and, looking at the all.yml file in the new phansible set up I've just created, I can't see a way to do this.

    Is it possible?

    Thanks,

    Me

    opened by ilithium 1
  • sudo/become at playbook level vs. task level

    sudo/become at playbook level vs. task level

    Phansible is currently generating projects that have sudo: true at the playbook level, but also many instances of sudo: yes at the task level.

    As far as I know, sudo: true at the playbook level will automatically make all tasks in that playbook run as sudo, unless overridden per task with sudo: false or sudo: no. This makes redundant the many instances of sudo: yes at the task level. Perhaps they should be removed.

    Alternatively, and this is my preference - sudo should only ever be defined at the task level. This is because, if a task is possible to achieve without becoming root, I'd rather do it as the vagrant user, and only elevate to root if absolutely necessary. In this case, sudo: true should be removed from playbook.yml.

    opened by discopatrick 3
  • Feature request: Phalcon PHP module

    Feature request: Phalcon PHP module

    Would be nice to be able to include the Phalcon framework PHP module.

    The PPA for Ubuntu is available at https://launchpad.net/~phalcon/+archive/ubuntu/stable.

    opened by kristoftorfs 1
  • Deprecation Warning: Using bare variables is deprecated

    Deprecation Warning: Using bare variables is deprecated

    One more to let you know:

    [DEPRECATION WARNING]: Using bare variables is deprecated. Update your ==> default: playbooks so that the environment value uses the full variable syntax ==> default: ('{{server.packages}}'). This feature will be removed in a future release. ==> default: Deprecation warnings can be disabled by setting deprecation_warnings=False in ==> default: ansible.cfg.
    

    Ansible version: 2.0.1.0

    difficulty/low issue/help-required issue/planned 
    opened by dianaarnos 2
  • Deprecation Warning: Instead of sudo/sudo_user, use become/become_user

    Deprecation Warning: Instead of sudo/sudo_user, use become/become_user

    I know you guys will remove all warnings, but I guess it's a good idea to help you list some:

    ==> default: [DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and ==> default: make sure become_method is 'sudo' (default). This feature will be removed in a ==> default: future release. Deprecation warnings can be disabled by setting ==> default: deprecation_warnings=False in ansible.cfg.
    

    Ansible version: 2.0.1.0

    difficulty/low issue/WIP issue/help-required issue/planned 
    opened by dianaarnos 22
Releases(0.7.2)
Owner
phansible
Phansible lets you easily generate Ansible provisions for PHP web servers
phansible
Vagrant is a tool for building and distributing development environments.

Vagrant Website: https://www.vagrantup.com/ Source: https://github.com/hashicorp/vagrant HashiCorp Discuss: https://discuss.hashicorp.com/c/vagrant/24

HashiCorp 22.3k Jul 24, 2021
Protobox is vagrant web GUI

Protobox Protobox is a layer on top of vagrant and a web GUI to setup virtual machines for web development. A single YAML document controls everything

protobox 353 Jul 1, 2021
Vagrant/Puppet GUI

PuPHPet PuPHPet - A simple GUI to set up virtual machines for PHP development What? PuPHPet is a web application that allows you to easily and quickly

PuPHPet 3.9k Jul 19, 2021
A development tool for all your projects that is fast, easy, powerful and liberating

Lando A Liberating Dev Tool For All Your Projects The local development and DevOps tool trusted by professional developers across the galaxy. Free you

Lando 3k Jul 24, 2021
A modern Docker LAMP stack and MEAN stack for local development

The Devilbox Usage | Architecture | Community | Features | Intranet | Screenshots | Contributing | Logos | License Support for valid https out of the

cytopia 3.5k Jul 27, 2021
Up and running with small Docker environments

Vessel Up and running with small Docker dev environments. Documentation Full documentation can be found at https://vessel.shippingdocker.com. Install

Shipping Docker 1k Jul 24, 2021
A fork of Laravel Valet to work in Linux.

Introduction Valet Linux is a Laravel development environment for Linux minimalists. No Vagrant, no /etc/hosts file. You can even share your sites pub

Carlos Priego 1.1k Jul 23, 2021
Stacker - The environment for local web development, ready for use.

Introduction English 简体中文 Why stacker? Stacker - This is a local environment for web development with everything you need. What is its benefit? You do

Nikolay Stepanov 355 Jun 26, 2021
Live Coding Project #1 | Création d'un annuaire téléphonique web (CRUD) ☎️📚

Live Coding #1 - Annuaire Téléphonique Ceci est un petit projet réalisé par les développeurs de Galsen Dev. Contribuer Si vous souhaitez une contribut

Galsen Dev LAB 9 Jun 30, 2021
Monitor for any changes in your php application and automatically restart it (suitable for async apps).

PHP-watcher PHP-watcher helps develop long-running PHP applications by automatically restarting them when file changes in the directory are detected.

Sergey Zhuk 324 Jul 27, 2021
后台管理系统包含用户角色权限管理,客户CRM,订单财务,群叫功能,可以实现一个中小型的呼叫中心系统

安装步骤 目前仅维护4.0和5.0分支,使用laravel 6.0 LTS版本 git clone -b 4.0 https://github.com/github-muzilong/freeswitch-gui.git 复制.env.example为.env 配置.env里的数据库连接信息 com

null 9 Jul 7, 2021
Symfony5 template w/ Docker config

Symfony5 w/ Docker config A project template in the following configuration: Symfony 5.2 PHP8 PostgreSQL 13.2 Separate Docker containers for Nginx, FP

Andrew Alyamovsky 4 Jun 28, 2021
Dockerized version of Laravel Homestead

laraedit-docker Dockerized version of Laravel Homestead Documentation For now you can check out the wiki for details on using the container. Once the

LaraEdit 441 Jun 7, 2021