rundeck配置salt-api
Rundeck 安装:
系统: # cat /etc/issue CentOS release 6.7 (Final) 内核: # uname -r 2.6.32-573.el6.x86_64 IP 地址: 172.16.5.16 运行账户: root jdk环境: # java -version java version "1.8.0_92" 安装方式: yum 官方发 Yum 源。
yum 安装
rpm -Uvh https://repo.rundeck.org/latest.rpm yum install rundeck service rundeckd start yum upgrade rundeck rundeck-config
登陆管理:
RunDeck Web界面的登录帐号管理,默认管理员帐号是admin,密码admin URL : http://172.16.5.16:4440
Rundeck 问题总结:
1、登陆提交表单错误 修改文件 framework.properties 文件和 rundeck-config.properties # sed -i 's/localhost/172.16.5.16/g' /etc/rundeck/framework.properties # sed -i 's/localhost/172.16.5.16/g' /etc/rundeck/rundeck-config.properties 或者 # vi /etc/rundeck/framework.properties framework.server.name = 172.16.5.16 framework.server.hostname = 172.16.5.16 framework.server.port = 4440 framework.server.url = http://172.16.5.16:4440 rdeck.base=/var/lib/rundeck framework.projects.dir=/var/lib/rundeck/projects framework.etc.dir=/etc/rundeck framework.var.dir=/var/lib/rundeck/var framework.tmp.dir=/var/lib/rundeck/var/tmp framework.logs.dir=/var/lib/rundeck/logs framework.libext.dir=/var/lib/rundeck/libext framework.ssh.keypath = /var/lib/rundeck/.ssh/id_rsa framework.ssh.user = rundeck framework.ssh.timeout = 0 rundeck.server.uuid = 0b407911-5980-4237-ae08-ba3532faa503 # 把localhost 更改为本机IP # vi /etc/rundeck/rundeck-config.properties grails.serverURL=http://172.16.5.16:4440 rundeck 问题;新创建项目 加密异常。JCE 密码扩展文件; jar包下载地址: https://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html 解压缩之后 jar包 替换到 java 环境变量下。 # unzip jce_policy-8.zip Archive: jce_policy-8.zip creating: UnlimitedJCEPolicyJDK8/ inflating: UnlimitedJCEPolicyJDK8/local_policy.jar inflating: UnlimitedJCEPolicyJDK8/README.txt inflating: UnlimitedJCEPolicyJDK8/US_export_policy.jar # 替换目录: /usr/local/java/jre/lib/security
rundeck 默认是 H2 数据库;
创建 salt 库示例:
Mysql默认编码格式latin1 (需要保证数据存的编码格式和数据库编码格式一样) mysql> show variables like "%char%";
1、创建数据库 设置utf8 编码格式。(my.cnf 也可以配置) mysql> create database salt character set utf8; 2、非本机设置开启当前库远程链接 (% 是所有 。可以设置localhost 本机IP ) mysql> grant all privileges on salt.* to salt@'%' identified by 'salt'; mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit
更改mysql数据库
编辑 /etc/rundeck/rundeck-config.properties 配置文件 dataSource.url = jdbc:mysql://172.16.5.16:3306/rundeck?autoReconnect=true dataSource.username = salt dataSource.password = salt dataSource.driverClassName = com.mysql.jdbc.Driver dataSource.url 参数示例: &useSSL=false &useUnicode=true &characterEncoding=UTF-8 &useJDBCCompliantTimezoneShift=true &useLegacyDatetimeCode=false &serverTimezone=UTC
重启rundeck服务。
Rundeck 配置salt-API 应用。
添加项目 - Job - node 执行命令
1、project 添加
2、job 导入导出
3、node添加