grains工具grains是在minion启动时收集到的一些信息,如操作系统类型、网卡ip、内核版本、cpu架构等信息salt‘selecthostname‘grains.ls列出所有grains项目名字sakt‘selecthostname‘grains.items列出所有的grains项目与值grains的信息并不是动态的,不会实时变更,只有在minion启动
分类:
其他好文 时间:
2018-12-06 17:46:05
阅读次数:
226
docker常见命令:Management Commands: builder Manage builds 管理构建 config Manage Docker configs 管理Docker配置 create Create a config from a file or STDIN 从文件或STD ...
分类:
其他好文 时间:
2018-12-05 21:44:49
阅读次数:
420
Desired Capabilities are keys and values encoded in a JSON object, sent by Appium clients to the server when a new automation sessionis requested. The ...
分类:
移动开发 时间:
2018-12-04 22:42:07
阅读次数:
344
Appium - automation for mobile apps 一.Appium架构介绍 官网:www.appium.io 由SauceLab公司主持。并在Google的GATC2013会上被详细介绍。 Appium是由nodejs的express框架写的Http Server。Appium ...
分类:
移动开发 时间:
2018-12-03 15:22:45
阅读次数:
275
涉及函数: password_hash(),password_verify()。 注意:password_hash 函数 支持算法中的PASSWORD_BCRYPT 使用时不建议使用salt后期版本可能将被废除,cost视服务器性能通常8-10。 ...
分类:
Web程序 时间:
2018-12-02 22:52:52
阅读次数:
293
目标
https://docs.saltstack.com/en/latest/
模块
https://docs.saltstack.com/en/latest/ref/modules/all/index.html
salt ‘*‘ service.available sshd 验证sshd服务
[root@master ~]# grep -v ‘^$‘ /etc/salt/master |grep -v ‘#‘
client_acl: #客户端开启模块限制
luo: #用户名
- test.ping
- network.*
file_roots:
base:
- /srv/salt
pillar_roots:
base:
- /srv/pillar
[root@master ~]# systemctl restart salt-master
给用户授权
[root@master ~]# useradd luo
useradd:用户“luo”已存在
[root@master ~]# passwd
分类:
其他好文 时间:
2018-12-01 00:13:20
阅读次数:
235
状态模块:
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#module-salt.states.file
[root@master ~]# grep -v ‘^$‘ /etc/salt/master |grep -v ‘#‘
client_acl:
luo:
- test.ping
- network.*
file_roots: #top.sls路径,可以写多个
base: #但是只读取base路径
- /srv/salt/base
test:
- /srv/salt/test
prod:
- /srv/salt/prod
pillar_roots:
base:
- /srv/pillar
mysql.host: ‘192.168.43.118‘
mysql.user: ‘salt‘
mysql.pass: ‘Myq1231!‘
mysql.db: ‘salt‘
mysql.port: 330
分类:
其他好文 时间:
2018-12-01 00:08:52
阅读次数:
253
[root@master ~]# mkdir /srv/salt/prod/pkg
[root@master ~]# mkdir /srv/salt/prod/haproxy
[root@master ~]# mkdir /srv/salt/prod/haproxy/files
[root@master pkg]# pwd
/srv/salt/prod/pkg
[root@master pkg]# vim pkg-init.sls
[root@master pkg]# cat pkg-init.sls
pkg-init:
pkg.installed:
- names:
- gcc
- gcc-c++
- glibe
- make
- autoconf
- openssl
- openssl-devel
[root@master prod]# cd haproxy/files/
[root@master files]# wget https://fossies.org/linux/mis
分类:
其他好文 时间:
2018-12-01 00:04:37
阅读次数:
225
[root@localhost master]# salt-key -A 同意所有
[root@localhost master]# salt-key -a 192* 可选 *代表所有
-L 列表
-D 删除所有
-d 删除选中的
[root@localhost master]# salt-key -a 192*
The following keys are going to be accepted:
Unaccepted Keys:
192.168.43.118
192.168.43.71
Proceed? [n/Y] Y
Key for minion 192.168.43.118 accepted.
Key for minion 192.168.43.71 accepted.
分类:
其他好文 时间:
2018-11-30 22:34:43
阅读次数:
246
Python脚本如下#!/usr/bin/envpythonimportsalt.utils.eventevent=salt.utils.event.MasterEvent("/var/run/salt/master")foriteminevent.iter_events(full=True):printitem效果:
分类:
编程语言 时间:
2018-11-26 20:00:07
阅读次数:
224