thedumbtechguy.semaphore

Ansible 角色:Semaphore

一个用于安装和配置 Ansible Semaphore 的 Ansible 角色。

此角色包含一个 Shell 脚本,用于引导 Ansible 和 Semaphore。它处理所需依赖项的设置和安装。

需求

此角色仅在 Ubuntu 16.04Ubuntu 16.10 上测试过。

引导安装

如果这是一个新服务器,您需要先设置主机名(hostname server.domain.tld)。

复制并运行以下命令:

sudo apt-get install -y wget &&
  mkdir /tmp/bootstrap &&
  cd /tmp/bootstrap &&
  wget https://raw.githubusercontent.com/thedumbtechguy/ansible-semaphore-bootstrap/master/bootstrap.sh &&
  sudo sh bootstrap.sh init

然后,您可以在 vars.json 中自定义配置,并运行 sudo sh bootstrap.sh execute

变量

  • semaphore_version:要安装的版本。

    • 默认:2.3.0
    • 选项:
      • 2.2.0
      • 2.3.0
  • semaphore_port:监听的端口。

    • 默认:3000
  • semaphore_db_name:要为 Semaphore 创建的数据库名称。

    • 默认:semaphore
  • semaphore_db_auth_user:应用程序数据库用户的名称。

    • 默认:semaphore
  • semaphore_db_auth_password:应用程序数据库用户的密码。

    • 必填
  • semaphore_db_auth_privileges:授予应用程序数据库用户的权限。

    • 默认:*.*:ALL
  • semaphore_config_auth_name:默认的 Semaphore 应用程序用户名称。

    • 默认:Admin
  • semaphore_config_auth_email:默认的 Semaphore 应用程序用户的电子邮件。

    • 默认:root
  • semaphore_config_auth_username:默认的 Semaphore 应用程序用户的用户名。

    • 默认:admin
  • semaphore_config_auth_password:默认的 Semaphore 应用程序用户的密码。

    • 必填
  • semaphore_config_data_dir:存储 Semaphore 配置和剧本文件的位置。

    • 默认:/var/lib/semaphore
  • semaphore_config_log_path:存储日志文件的位置。

    • 默认:/var/log/semaphore
  • semaphore_config_email_alerts_enable:启用电子邮件警报。

    • 默认:no
  • semaphore_config_email_alerts_server:SMTP 服务器。

    • 默认:localhost
  • semaphore_config_email_alerts_port:SMTP 端口。

    • 默认:25
  • semaphore_config_email_alerts_sender:电子邮件发送者地址。

    • 默认:semaphore@localhost
  • semaphore_config_web_root:通过此 URL 访问应用程序的根目录。

    • 默认:http://{{ ansible_fqdn }}:{{ semaphore_port }}/
  • semaphore_config_telegram_alerts_enable:启用 Telegram 警报。

    • 默认:no
  • semaphore_config_telegram_alerts_bot_token:从 @BotFather 获取。

    • 默认:''
  • semaphore_config_telegram_alerts_chat_id:您的 Telegram 聊天 ID。

    • 默认:''
  • semaphore_config_ldap_enable:启用 LDAP 身份验证。

    • 默认:no
  • semaphore_config_ldap_server:LDAP 服务器。

    • 默认:localhost
  • semaphore_config_ldap_port:LDAP 端口。

    • 默认:389
  • semaphore_config_ldap_use_tls:连接到 LDAP 服务器时使用 TLS。

    • 默认:no
  • semaphore_config_ldap_bind_dn:绑定 DN。

    • 默认:cn=user,ou=users,dc=example.tld
  • semaphore_config_ldap_bind_password:。

    • 默认:pa55w0rd
  • semaphore_config_ldap_search_dn:搜索 DN。

    • 默认:ou=users,dc=example.tld
  • semaphore_config_ldap_search_filter:搜索过滤器。

    • 默认:(uid=%s)
  • semaphore_config_ldap_mapping_dn_field:映射到 DN 字段。

    • 默认:dn
  • semaphore_config_ldap_mapping_username_field:映射到用户名字段。

    • 默认:uid
  • semaphore_config_ldap_mapping_fullname_field:映射到全名字段。

    • 默认:cn
  • semaphore_config_ldap_mapping_email_field:映射到电子邮件字段。

    • 默认:mail
  • semaphore_service_user_name:将运行应用程序服务的帐户。不要以 root 用户身份运行。

    • 默认:semaphore

      注意:如果用户不存在,将创建服务帐户。

  • semaphore_service_user_password:将运行该服务的帐户的密码。

    • 必填

      注意:不提供此项将允许该帐户获得无密码的 sudo 权限。

      该密码用于通过 become_password 从 Semaphore 运行本地剧本。

      密码应为与 ansible 用户模块 兼容的加密值。

      您可以使用以下命令创建一个: python -c 'import crypt; print crypt.crypt("This is the password", "$1$ThisIsSomeSalt$")'

引导

这些变量仅与引导过程相关,可在生成的 vars.json 文件中修改。

  • semaphore_db_admin_home:存储 MariaDB 的 .my.cnf 的目录。

    • 默认:/root
  • semaphore_db_admin_user:数据库管理员用户名。

    • 默认:admin
  • semaphore_db_admin_password:数据库管理员密码。

    • 必填
  • semaphore_ansible_cfg_vault_password:保管库密码。

    • 默认:''
  • semaphore_ansible_cfg_vault_password_file:保管库密码文件的位置。

    • 默认:/var/lib/semaphore/.vpf
  • semaphore_ansible_cfg_host_key_checking:启用主机密钥检查。

    • 默认:False
    • 选项:
      • True
      • False
  • semaphore_ansible_cfg_ansible_managed:用于管理文件的 ansible 管理字符串。一些角色会用到。

    • 默认:DO NOT MODIFY by hand. This file is under control of Ansible on {host}.

使用示例

- hosts: all
  vars:
    semaphore_config_auth_email: '[email protected]'
    semaphore_config_auth_password: '4dm1nPa55w0rd'
    semaphore_service_user_password: '$1$ThisIsSo$RwIOJHdSWIzAJjbvBdbOZ0'
    semaphore_ansible_cfg_vault_password: 'pa55w0rd'
  roles:
    - thedumbtechguy.semaphore

许可证

MIT / BSD

作者信息

此角色由 TheDumbTechGuy 创建( Twitter | 博客 | Galaxy

致谢

关于项目

Ansible-Semaphore for Linux.

安装
ansible-galaxy install thedumbtechguy.semaphore
许可证
Unknown
下载
114
拥有者