下载、安装
Rundeck
1 2
| [root@ningan rundeck] [root@ningan rundeck]
|
启动
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| [root@ningan rundeck] [ ok ] Starting rundeckd (via systemctl): rundeckd.service. [root@ningan rundeck]
[root@ningan rundeck] rundeck 6677 1 99 14:52 ? 00:01:28 java -Drundeck.jaaslogin=true -Djava.security.auth.login.config=/etc/rundeck/jaas-loginmodule.conf -Dloginmodule.name=RDpropertyfilelogin -Drdeck.config=/etc/rundeck -Drundeck.server.configDir=/etc/rundeck -Dserver.datastore.path=/var/lib/rundeck/data/rundeck -Drundeck.server.serverDir=/var/lib/rundeck -Drdeck.projects=/var/lib/rundeck/projects -Dlog4j.configurationFile=/etc/rundeck/log4j2.properties -Dlogging.config=file:/etc/rundeck/log4j2.properties -Drdeck.runlogs=/var/lib/rundeck/logs -Drundeck.server.logDir=/var/lib/rundeck/logs -Drundeck.config.location=/etc/rundeck/rundeck-config.properties -Djava.io.tmpdir=/tmp/rundeck -Drundeck.server.workDir=/tmp/rundeck -Dserver.http.port=4440 -Drdeck.base=/var/lib/rundeck -Xmx1024m -Xms256m -XX:MaxMetaspaceSize=256m -server -jar /var/lib/rundeck/bootstrap/rundeck-4.15.0-20230725.war --skipinstall root 7234 25419 0 14:53 pts/0 00:00:00 grep --color=auto runde
[root@ningan rundeck] tcp6 0 0 :::4440 :::* LISTEN 6677/java
|
在宿主机上访问:http://192.168.20.201:4440/ 进行访问,用户名和密码都输入admin,一直在转圈圈进不去。后来找了网上的博客,在访问前需要修改配置文件/etc/rundeck/rundeck-config.properties
修改这一行,
1 2 3 4
| 将 grails.serverURL=http://localhost:4440 修改为 grails.serverURL=http://192.168.20.201:4440
|
修改完之后,重启
1 2 3 4 5 6
| [root@ningan rundeck]
[root@ningan rundeck] tcp6 0 0 :::4440 :::* LISTEN 6677/java
|
等4440已经启动起来了,再次在浏览器中访问,就能进去了~
常用命令
1
| rundeckd [start|stop|restart|condrestart|status]
|
常用操作
创建token
常用接口操作
查询project的列表信息
执行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| GET /api/30/project/:project/jobs curl http://192.168.20.201:4440/api/30/project/paas/jobs?authtoken=NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp -H "Accept: application/json" |jq
POST /api/32/job/:jobId/executions curl -X POST "http://192.168.20.201:4440/api/30/job/1411fc5a-fdd5-45b3-b4c2-fa2737aae459/executions" -H "Content-Type: application/json" -H "X-Rundeck-Auth-Token: NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp" -H "Accept: application/json" |jq
curl http://192.168.20.201:4440/api/30/project/paas/executions?authtoken=NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp -H "Accept: application/json" |jq
curl http://192.168.20.201:4440/api/30/execution/5/output?authtoken=NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp -H "Accept: application/json" |jq
curl -X GET "http://192.168.20.201:4440/api/30/project/paas/executions?jobFilter=ls" -H "X-Rundeck-Auth-Token:NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp" -H "Accept: application/json" |jq
curl -X GET "http://192.168.20.201:4440/api/30/project/paas/executions?jobFilter=ls" -H "X-Rundeck-Auth-Token:NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp" -H "Accept: application/json" |jq '.executions | sort_by(.dateEnded) | reverse | .[-1]' curl -X GET "http://192.168.20.201:4440/api/30/project/paas/executions?jobFilter=ls" -H "X-Rundeck-Auth-Token:NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp" -H "Accept: application/json" |jq '.executions | sort_by(.dateEnded) | last' curl -X GET "http://192.168.20.201:4440/api/30/project/paas/executions?jobFilter=ls" -H "X-Rundeck-Auth-Token:NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp" -H "Accept: application/json" |jq '.executions | sort_by(.dateEnded) | reverse | .[0]' curl -X GET "http://192.168.20.201:4440/api/30/project/paas/executions?jobFilter=execEchoShell" -H "X-Rundeck-Auth-Token:NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp" -H "Accept: application/json" |jq '.executions | sort_by(.dateEnded) | reverse | .[0]'
curl -X GET "http://192.168.20.201:4440/api/30/execution/33/output" -H "X-Rundeck-Auth-Token:NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp" -H "Accept: application/json"
curl -s -H "X-Rundeck-Auth-Token: YOUR_AUTH_TOKEN" "http://RUNDECK_SERVER/api/14/execution/EXECUTION_ID/output"
curl http://192.168.20.201:4440/api/30/project/paas/executions?authtoken=NdUB89tWpe87NFmUhRyCX9V6ZDie1HDp -H "Accept: application/json" |jq
|