GuillaumeSmaha.gluu-customization

Ansible Gluu:自定义角色

gluu-customization 是一个 Ansible 角色,用于通过复制 XHTML 页面、图像、样式资源或编辑 WAR 文件来轻松自定义 Gluu 服务器上的文件,例如更新翻译。

历史

Gluu 的开源认证和 API 访问管理服务器使组织能够提供单点登录、强身份验证,并实现集中管理。

需求

要进行部署,您需要:

  • 在部署机器上安装 Ansible

安装

gluu-customization 是一个通过 Ansible Galaxy 分发的 Ansible 角色。要安装 gluu-customization 角色,可以使用以下命令。

$ ansible-galaxy install GuillaumeSmaha.gluu-customization

更新

如果您想更新该角色,安装时需要传递 --force 参数。请检查以下命令:

$ ansible-galaxy install --force GuillaumeSmaha.gluu-customization

角色变量

vars:

  # 定义要安装的自定义版本包。
  # 要获取可用包版本列表,请访问: https://gluu.org/docs/ce/
  gluu_version: 3.1.4

  # 列出要复制到 Gluu 容器内 /etc/gluu/conf 的文件
  # 可以使用 Jinja 模板
  # 示例:
  # gluu_copy_configuration_files:
  #   - 'template/configuration/auth_multi_ldap.json'
  gluu_copy_configuration_files:

  # 列出要复制到目录 /etc/gluu/jetty/{{ module }}/custom/pages 的 XHTML 页面
  # 可用可选的 'dest' 参数
  # 可以使用 Jinja 模板,因此可以使用相对路径从 'templates' 目录
  # 示例:
  # gluu_copy_pages:
  #   oxauth:
  #     - path: 'template/pages/login.xhtml'
  #     - path: 'template/pages/login_template.xhtml'
  #       dest: 'WEB-INF/incl/layout/login-template.xhtml'
  gluu_copy_pages:

  # 列出要复制到目录 /etc/gluu/jetty/{{ module }}/custom/static 的页面资源
  # 不能使用 Jinja 模板。因此,您必须指定绝对路径。
  # 示例:
  # gluu_copy_resources:
  #   oxauth:
  #     - path: '{{ playbook_dir }}/templates/custom/oxauth/static/logo.svg'
  #       dest: 'img/logo.svg'
  #     - path: '{{ playbook_dir }}/templates/custom/oxauth/static/error.png'
  #       dest: 'img/error.png'
  gluu_copy_resources:


  # 列出要复制到 WAR 文件中的文件。
  # WAR 文件将被解压,文件将被复制,然后重新创建归档。
  # 可以使用 Jinja 模板;因此可以使用相对路径从 'templates' 目录
  # 示例自定义可用语言和翻译:
  # gluu_customize_wars:
  #   oxauth:
  #     - path: 'wars/oxauth/messages_fr.properties'
  #       dest: 'WEB-INF/classes/messages_fr.properties'
  #     - path: 'wars/oxauth/messages_en.properties'
  #       dest: 'WEB-INF/classes/messages_en.properties'
  #     - path: 'wars/oxauth/faces-config.xml'
  #       dest: 'WEB-INF/faces-config.xml'
  gluu_customize_wars:

部署

要进行部署,您需要执行以下步骤:

  • 创建一个新的 hosts 文件。如果需要帮助,请查看 ansible inventory documentation
  • 创建一个新的剧本来部署您的应用程序,例如 deploy.yml
  • 设置角色变量(见 角色变量
  • GuillaumeSmaha.gluu-customization 角色包含在剧本中
  • 运行部署剧本

ansible-playbook -i hosts deploy.yml

如果一切设置正确,该命令将在主机上安装 Gluu 集群管理器。

示例剧本

在示例文件夹中,您可以查看一个示例项目,展示了如何进行部署。

要运行它,您需要安装 Vagrant 和该角色。有关 Vagrant 的更多信息,请访问 https://www.vagrantup.com 以及我们的安装部分。

$ cd example
$ vagrant plugin install vagrant-lxc
$ vagrant plugin install vagrant-hostmanager
$ vagrant up --provider=lxc
$ ansible-galaxy install GuillaumeSmaha.gluu-setup GuillaumeSmaha.gluu-customization
$ ansible-playbook -i env/ubuntu deploy.yml
$ ansible-playbook -i env/centos deploy.yml

通过访问以下链接访问 Gluu:

https://gluu-customization-ubuntu/

https://gluu-customization-centos/

示例项目

您可以在此处找到完整的剧本示例:

https://github.com/GuillaumeSmaha/ansible-gluu-playbook

关于项目

Gluu Customization for RHEL/CentOS and Ubuntu

安装
ansible-galaxy install GuillaumeSmaha.gluu-customization
许可证
gpl-3.0
下载
148
拥有者