欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

Ansible WebUI工具之Semaphore

发布时间:2025/1/21 编程问答 30 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Ansible WebUI工具之Semaphore 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

semaphore 是一款基于GO语言编写的 Ansible-WebUI系统,同类产品还有:

  • Tower,商业软件
  • awx,Tower的上游软件,开源免费,不适应于生产环境
  • ara 等

YUM安装

MySQL 安装

<略过>

Semphore 安装部署

  • 下载 deb包安装
  • # wget https://github.com/ansible-semaphore/semaphore/releases/download/v2.5.1/semaphore_2.5.1_linux_amd64.deb # dpkg -i semaphore_2.5.1_linux_amd64.deb
  • 查看安装状态
  • # semaphore -version v2.5.1
  • 初始化
  • semaphore -setup Hello! You will now be guided through a setup to:Set up configuration for a MySQL/MariaDB databaseSet up a path for your playbooks (auto-created)Run database MigrationsSet up initial semaphore user & password DB Hostname (default 127.0.0.1:3306): 127.0.0.1:3306DB User (default root): rootDB Password: <root Password> DB Name (default semaphore): semaphorePlaybook path (default /tmp/semaphore): /opt/semaphoreWeb root URL (optional, example http://localhost:8010/): http://localhost:8010/Enable email alerts (y/n, default n): nEnable telegram alerts (y/n, default n): nEnable LDAP authentication (y/n, default n): n <略过若干行>
  • 启动测试
  • # semaphore -config /root/config.json &
  • 使用systemd 管理
  • cat >/etc/systemd/system/semaphore.service<<EOF [Unit] Description=Semaphore Ansible UI Documentation=https://github.com/ansible-semaphore/semaphore Wants=network-online.target After=network-online.target[Service] Type=simple ExecReload=/bin/kill -HUP $MAINPID ExecStart=/usr/bin/semaphore -config /etc/semaphore/config.json SyslogIdentifier=semaphore Restart=always[Install] WantedBy=multi-user.target EOF# mkdir /etc/semaphore # sudo ln -s /root/config.json /etc/semaphore/config.json

    启用systemd 启动服务

    sudo systemctl start semaphore

    容器化部署

    version: '2'services:mysql:ports:- 3306:3306image: mysql:5.6hostname: mysqlenvironment:MYSQL_RANDOM_ROOT_PASSWORD: 'yes'MYSQL_DATABASE: semaphoreMYSQL_USER: semaphoreMYSQL_PASSWORD: semaphoresemaphore:ports:- 3000:3000image: ansiblesemaphore/semaphore:latestenvironment:SEMAPHORE_DB_USER: semaphoreSEMAPHORE_DB_PASS: semaphoreSEMAPHORE_DB_HOST: mysqlSEMAPHORE_DB_PORT: 3306SEMAPHORE_DB: semaphoreSEMAPHORE_PLAYBOOK_PATH: /tmp/semaphore/SEMAPHORE_ADMIN_PASSWORD: cangetinSEMAPHORE_ADMIN_NAME: adminSEMAPHORE_ADMIN_EMAIL: admin@localhostSEMAPHORE_ADMIN: admindepends_on:- mysql
  • 使用浏览器访问
  • http://SERVER_IP:3000

  • 任务执行日志
  • Ansible 代码: https://github.com/vqiu/for-semaphore

    资料引用

    • [1] https://computingforgeeks.com/install-semaphore-ansible-web-ui-on-ubuntu-debian/
    • [2] https://docs.ansible-semaphore.com

    参考连接:https://vqiu.cn/semaphore/

    总结

    以上是生活随笔为你收集整理的Ansible WebUI工具之Semaphore的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。