votum.magento2
Ansible 角色 votum.magento2
用于安装 Magento2 电子商务系统的 Ansible 角色。
要求
此角色依赖于远程服务器上安装的 Magerun2 CLI 工具。安装说明请参考 https://github.com/netz98/n98-magerun2。
角色变量
以下是可用变量及其默认值的列表。(另见 defaults/main.yml
)
magento2_instance_name: "magento2"
实例名称主要用作定时任务的标签。如果您想在同一服务器上使用此角色安装多个 Magento 实例,使用此功能会很有用。
magento2_version_to_install: "magento-ce-2.0.7"
要安装的 Magento 版本字符串。版本字符串取自 magerun2 安装命令。 可能的值包括:
magento-ce-2.1.0 magento-ce-2.0.7 magento-ce-2.0.6 magento-ce-2.0.5 magento-ce-2.0.4 magento-ce-2.0.2 magento-ce-2.0.1 magento-ce-2.0.0 ... (你应该理解这个意思)
magento2_install_path: "/var/www"
Magento 根目录的安装路径。注意: 这不是 vhost 的网站根目录。vhost 应指向 {{magento2_install_path}}/pub
。
magento2_magerun_bin_path: "/usr/local/bin/n98-magerun2.phar"
Magerun2 可执行文件的路径。安装过程依赖于 Magerun2 CLI 工具。有关更多信息和安装方法,请参见 http://magerun.net/tag/n98-magerun2/ 和 https://github.com/netz98/n98-magerun2。
magento2_install_sample_data: true
是否安装示例数据。默认值为 true。
magento2_enable_crons: true
是否启用 Magento2 定时任务。默认值为 true。
magento2_auth_public_key: "xxxxxxxxxxxxxxxxxxxxxx"
magento2_auth_private_key: "xxxxxxxxxxxxxxxxxxxxxx"
通过 Composer 安装 Magento2 需要拥有 Magento 的开发者账户。请在这里输入您的公钥和私钥,以便通过您的凭据启用无人值守安装。有关 Magento2 认证密钥的更多信息,请参见 http://devdocs.magento.com/guides/v2.0/install-gde/prereq/connect-auth.html 。
magento2_db_host: "127.0.0.1"
magento2_db_name: "magento2"
magento2_db_user: "root"
magento2_db_password: ""
magento2_db_prefix: ""
使用这些变量设置 Magento2 的数据库配置。这个比较容易理解。注意: 如果您的数据库运行在不同的端口,您可以使用 127.0.0.1:3306
的格式将其传递给 magento2_db_host
变量。
magento2_language: "en_US"
magento2_currency: "USD"
magento2_timezone: "Europe/Berlin"
Magento2 默认安装参数的附加选项,包括语言、货币和时区。有关可能的值,请参见 ./bin/magento info:language:list
、./bin/magento info:currency:list
和 ./bin/magento info:timezone:list
。
magento2_admin_firstname: "John"
magento2_admin_lastname: "Doe"
magento2_admin_email: "[email protected]"
magento2_admin_user: "admin"
magento2_admin_password: "admin123"
管理员登录信息。
magento2_backend_frontname: "admin"
管理员后台的 URL 路径。
magento2_base_url: "{{ '{{base_url}}' }}"
magento2_base_url_secure: ""
基础 URL(针对受 HTTPS 保护的区域,如客户账户和结账)。注意: URL 必须包含协议和尾部斜杠。默认值为 {{URL}},此值应从 vhost
配置中读取。到目前为止,这并不总是按预期工作。
magento2_use_rewrites: "1"
在商店前端和管理后台使用网络服务器重写生成的链接。
magento2_use_secure: "1"
使用安全 URL。仅在可用 SSL 时启用此选项。
magento2_use_secure_admin: "1"
使用 SSL 访问 Magento 管理后台。在选择此选项之前,请确保您的网络服务器支持 SSL。
magento2_use_security_key: "1"
是否在 Magento 管理后台的 URL 和表单中使用“安全密钥”功能。
magento2_session_save: "files"
会话保存处理程序(默认值:"files")。
magento2_cleanup_database: "1"
在安装前清理数据库。
magento2_key: ""
如果您有密钥,请指定一个用于加密 Magento2 数据库中的敏感数据。如果您没有,可以留空,Magento2 会为您生成一个。
magento2_sales_order_increment_prefix: ""
指定一个字符串值作为销售订单的前缀。通常使用此前缀来保证支付处理器的唯一订单号。
依赖关系
无。
示例剧本
---
- name: 设置 demo 安装 magento-ce-2.0
hosts: app
vars_files:
- group_vars/main.yml
- group_vars/magento2-ce20-demo.yml
pre_tasks: []
roles:
- { role: votum.magerun2 }
- { role: votum.magento2, ansible_become: yes, ansible_become_user: www-data }
post_tasks: []
许可证
MIT
作者信息
版权所有 VOTUM GmbH (info@votum.de)