fansible/symfony-ansible
Composer 安装命令:
composer require fansible/symfony-ansible
包简介
This will help you to provision and maintain your server up to date to run your Symfony apps
README 文档
README
See https://github.com/fansible/tywin for the newer version.
Ansible provisioning for Symfony project using composer
This project is meant to make the provisioning of servers running one Symfony app as easy and fast as possible.
Requirements
You should have on your server installed:
How to use it
-
Require fansible/symfony-ansible in your composer.json:
composer require --dev "fansible/symfony-ansible" -
Add the file ansible.cfg in your root directory with
[defaults] hostfile = app/config/ansible/hosts roles_path = vendor/fansible/symfony-ansible/roles
-
Add your hosts configurations. For vagrant, create a file called
vagrantinapp/config/ansible/hosts:[vagrant] vagrant ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 is_vagrant=true
-
Add the specific vars of your host. For vagrant, create a file called
vagrantinapp/config/ansible/hosts/group_vars:File: app/config/ansible/hosts/group_vars/vagrant
Write here the vars that are specific to your host
host_name: "vagrant-{{ name }}" web: server_name: "vagrant.project.com" iptables_allowed_tcp_ports: [22, 80, 443]
mysql_users:
- name: "{{ name }}" host: "%" pass: "{{ name }}"
-
If you have already installed Ansible, you can now run your provisioning.
For your vagrant: vagrant provision
For any hosts: ansible-playbook -i app/config/ansible/hosts/HOSTNAME vendor/fansible/symfony-ansible/playbook.yml -u root.
Bonus step for Vagrant
-
You need to create Here is a Vagrantfile you can use for your project:
-- mode: ruby --
vi: set ft=ruby :
TODO: Change the name
projectname = 'projectname'
Vagrant.configure("2") do |config| config.vm.hostname = projectname config.vm.box = "ubuntu/trusty64"
TODO: Change the directory
config.vm.network :private_network, ip: "10.0.0.7"
TODO: Change the directory
config.vm.synced_folder "./", "/var/www/" + projectname + "/current", type: "nfs"
config.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--cpuexecutioncap", "100"] v.customize ["modifyvm", :id, "--memory", 2048] v.customize ["modifyvm", :id, "--cpus", 2] end
config.ssh.forward_agent = true
# Ansible see https://docs.vagrantup.com/v2/provisioning/ansible.html config.vm.provision "ansible" do |ansible| ansible.sudo = true ansible.playbook = "vendor/fansible/symfony-ansible/playbook.yml" ansible.limit = 'vagrant' ansible.inventory_path = "app/config/ansible/hosts/vagrant" ansible.verbose = "v" #Use vvvv to get more log end end
-
Change your web/app_dev.php to allow remote connection. You can copy/paste:
loadClassCache(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);
fansible/symfony-ansible 适用场景与选型建议
fansible/symfony-ansible 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 8, 最近一次更新时间为 2015 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Provisioning Server Ansible Security」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fansible/symfony-ansible 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fansible/symfony-ansible 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fansible/symfony-ansible 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP wrapper for Ansible.
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
Create vm for develop by ansible and docker
This will help you to generate a provisioning to run your Symfony apps
A jQuery augmented PHP library for creating and validating HTML forms
annotations-scan-plugin
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-19