weareinteractive.php5

Ansible weareinteractive.php5 角色

构建状态
Galaxy
GitHub 标签
GitHub 星标

weareinteractive.php5 是一个 Ansible 角色,它:

  • 安装 php5
  • 配置 php5
  • 安装额外的软件包
  • 安装 pear 软件包
  • 安装 pecl 软件包
  • 配置 logrotate

安装

使用 ansible-galaxy

$ ansible-galaxy install weareinteractive.php5

使用 requirements.yml

- src: weareinteractive.php5

使用 git

$ git clone https://github.com/weareinteractive/ansible-php5.git weareinteractive.php5

依赖

  • Ansible >= 2.4
    注意:

    由于 Ansible Galaxy 现在支持 组织,该角色已从 franklinkim.php5 移动到 weareinteractive.php5

变量

以下是该角色的所有默认变量列表,这些变量也可以在 defaults/main.yml 中找到。

---
# 有关默认变量的更多信息,请参见:
# http://www.ansibleworks.com/docs/playbooks_variables.html#id26
#
# php5_packages:
#   - php5-gd
#   - php5-dev
# php5_cli_config:
#   - { section: PHP, option: default_charset, value: UTF-8 }
# php5_apache2_config:
#   - { section: PHP, option: default_charset, value: UTF-8 }
# php5_modules:
#  - { name: gd, config: [] }
#  - { name: curl, config: [] }
#  - { name: tidy, config: [] }
#  - { name: mysql, config: [] }
#  - { name: mcrypt, config: [] }
#  - { name: xmlrpc, config: [] }
#  - { name: xdebug, config: [] }
#  - { name: imagick, config: [] }
#  - { name: mail, type: 'php', config: [] }
#  - { name: mail-mime, type: 'php', config: [] }
# php5_pear_packages:
#  - Mail_IMAPv2
# php5_pecl_packages:
#  - { name: yaml, config: [] }
#  - { name: mailparse, config: [] }

# 用户
php5_user: www-data
# apt 包(版本)
php5_packages:
  - php5
  - php5-dev
  - php5-cli
  - php-pear
# 错误日志路径
php5_log_path: /var/log/php5
# cli 配置设置
php5_cli_config: []
# fpm 配置设置
php5_fpm_config: []
# apache 配置设置
php5_apache2_config: []
# 要安装的 pear 包列表
php5_pear_packages: []
# 要安装的 pecl 包列表
php5_pecl_packages: []
# 要安装和配置的 php 模块列表
php5_modules: []

处理程序

以下是在 handlers/main.yml 中定义的处理程序。

---

- name: 重启 apache2
  service: name=apache2 state=restarted

- name: 重启 php5-fpm
  service: name=php5-fpm state=restarted

使用

这是一个示例剧本:

---

- hosts: all
  become: yes
  roles:
    - weareinteractive.apt
    - weareinteractive.php5
  vars:
    php5_cli_config:
      - { section: PHP, option: default_charset, value: UTF-8 }
      - { section: Date, option: date.timezone, value: Europe/Berlin }
      - { section: PHP, option: error_log, value: /var/log/php5/error-cli.log }
    php5_pear_packages:
      - { name: Mail, config: [] }
    php5_pecl_packages:
      - { name: hrtime, config: [] }

测试

$ git clone https://github.com/weareinteractive/ansible-php5.git
$ cd ansible-php5
$ make test

贡献

在缺乏正式风格指南的情况下,请注意保持现有的编码风格。为任何新的或更改的功能添加单元测试和示例。

  1. fork 一份
  2. 创建你的功能分支(git checkout -b my-new-feature
  3. 提交更改(git commit -am '添加某个功能'
  4. 推送到分支(git push origin my-new-feature
  5. 创建新的 Pull Request

注意:要更新 README.md 文件,请安装并运行 ansible-role

$ gem install ansible-role
$ ansible-role docgen

许可证

版权所有 (c) We Are Interactive,遵循 MIT 许可证。

关于项目

Installs and configures php5

安装
ansible-galaxy install weareinteractive.php5
许可证
mit
下载
414