semaphere deployment, configure ldap

When working on Ansible-related projects, we often face tedious command line operations, which may be a challenge for users who are not familiar with the command line. Additionally, when a project scales, it becomes difficult to track and manage multiple playbooks, while timely notification of failures and access control are lacking. These questions gave birth to Ansible Semaphore.
Ansible Semaphore aims to solve these problems. It provides a modern user interface that makes running Ansible playbooks simple and efficient through intuitive operations and visualization tools. Both new and experienced developers can easily manage and deploy projects with Ansible Semaphore.

1. First download the binary file version of semaphore to customize

wget https://github.com/ansible-semaphore/semaphore/releases/\
download/v2.8.75/semaphore_2.8.75_linux_amd64.tar.gz

tar xf semaphore_2.8.75_linux_amd64.tar.gz

./semaphore setup
按照交互式的提示输入配置项会生成config.json
最后执行./semaphore service --config=./config.json

config.json configuration

{
        "mysql": {
                "host": "10.72.88.200:3306",
                "user": "semaphere",
                "pass": "semaphere",
                "name": "semaphere",
                "options": null
        },
        "bolt": {
                "host": "",
                "user": "",
                "pass": "",
                "name": "",
                "options": null
        },
        "postgres": {
                "host": "",
                "user": "",
                "pass": "",
                "name": "",
                "options": null
        },
        "dialect": "mysql",
        "port": "",
        "interface": "",
        "tmp_path": "/data/semaphere",
        "cookie_hash": "dlL7hN+6zGPl9nA+b7qMH9KxTc1e0j5kFhwFxnxbJO4=",
        "cookie_encryption": "6cIiVCnjLS+CADd4Gf5ifAPmef6ZFUzzLogT/0C8dVc=",
        "access_key_encryption": "HnFwKdZbd5qyS0a0Dp0KBJ05mJAdRQuGcI5Y2bA0Vrw=",
        "email_sender": "",
        "email_host": "",
        "email_port": "",
        "email_username": "",
        "email_password": "",
        "web_host": "",
        "ldap_binddn": "cn=xiaomao,cn=managers,dc=test,dc=com",
        "ldap_bindpassword": "Root@saxofintech",
        "ldap_server": "10.72.88.200:31683",
        "ldap_searchdn": "dc=test,dc=com",
        "ldap_searchfilter": "(&(objectClass=inetOrgPerson)(cn=%s))",
        "ldap_mappings": {
                "dn": "",
                "mail": "mail",
                "uid": "cn",
                "cn": "cn"
        },
        "ldap_enable": true,
        "ldap_needtls": false,
        "telegram_chat": "",
        "telegram_token": "",
        "slack_url": "",
        "max_parallel_tasks": 0,
        "email_alert": false,
        "email_secure": false,
        "telegram_alert": false,
        "slack_alert": false,
        "ssh_config_path": "",
        "demo_mode": false
 }

数据库选一个就可以,然后ldap根据自己的值来配置,当配置完成后第一个登录的用户是没有admin的权限的需要手动给一下admin的权限,
UPDATE semaphere.user SET admin=1 WHERE username='xxx';

Run as system service

sudo cat > /etc/systemd/system/semaphore.service <<EOF
[Unit]
Description=Semaphore Ansible
Documentation=https://github.com/ansible-semaphore/semaphore
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/path/to/semaphore service --config=/path/to/config.json
SyslogIdentifier=semaphore
Restart=always
RestartSec=10s

[Install]
WantedBy=multi-user.target
EOF

Guess you like

Origin blog.csdn.net/qq_39412605/article/details/132897156