Erlo

Saltstack_使用指南05_数据系统-Pillar

2019-03-29 21:18:17 发布   996 浏览  
页面报错/反馈
收藏 点赞

 

1. 主机规划

 

Pillar文档

https://docs.saltstack.com/en/latest/topics/pillar/index.html

 

注意事项

修改了master或者minion的配置文件,那么必须重启对应的服务。

 

2. Grains VS Pillar

 

3. Pillar基本信息

 1 Pillar
 2     Pillar数据是动态的        给特定的minion指定特定的数据。
 3         只有指定的minion自己能够看到自己的数据  【所以必须要有top.sls】
 4         因此可以用于敏感数据
 5 
 6 Pillar刷新:
 7 salt '*' saltutil.sync_all   # 可以使用但是不推荐  
 8 salt '*' saltutil.sync_pillar  有报错,适用于无master模式【masterless】  
 9 salt '*' saltutil.refresh_modules  刷新的是模块,所以不建议使用  
10 salt '*' saltutil.refresh_pillar  # 推荐使用 ★★★★★
11 
12 特别注意:
13     如果不执行salt '*' saltutil.refresh_pillar 直接使用 salt '*' pillar.items 查看信息,也可看见信息是最新的,
14     但是查看具体要更新项时却是旧信息,所以必须要执行pillar刷新命令。
15 
16 使用:
17 1、目标选择
18 2、配置管理
19 3、机密数据【敏感数据】

 

4. 显示系统自带的pillar

系统自带的pillar默认是不显示的

注意:看完之后还原回去,因为数据较多。和自定义数据杂在一起,不方便查看

 

4.1. 修改配置文件并重启服务

 1 [root@salt100 ~]# salt 'salt01' pillar.items  # 默认不显示pillar信息 
 2 salt01:
 3     ----------
 4 [root@salt100 ~]# vim /etc/salt/master  
 5 ………………
 6 # The pillar_opts option adds the master configuration file data to a dict in
 7 # the pillar called "master". This is used to set simple configurations in the
 8 # master config file that can then be used on minions.
 9 #pillar_opts: False
10 pillar_opts: True
11 ………………
12 [root@salt100 ~]# systemctl restart salt-master.service  # 修改了配置文件,重启服务

 

4.2. 显示pillar信息

  1 [root@salt100 ~]# salt 'salt01' pillar.items  # 显示系统pillar信息
  2 salt01:
  3     ----------
  4     master:
  5         ----------
  6         __cli:
  7             salt-master
  8         __role:
  9             master
 10         allow_minion_key_revoke:
 11             True
 12         archive_jobs:
 13             False
 14         auth_events:
 15             True
 16         auth_mode:
 17             1
 18         auto_accept:
 19             False
 20         azurefs_update_interval:
 21             60
 22         cache:
 23             localfs
 24         cache_sreqs:
 25             True
 26         cachedir:
 27             /var/cache/salt/master
 28         clean_dynamic_modules:
 29             True
 30         cli_summary:
 31             False
 32         client_acl_verify:
 33             True
 34         cluster_masters:
 35         cluster_mode:
 36             False
 37         con_cache:
 38             False
 39         conf_file:
 40             /etc/salt/master
 41         config_dir:
 42             /etc/salt
 43         cython_enable:
 44             False
 45         daemon:
 46             False
 47         decrypt_pillar:
 48         decrypt_pillar_default:
 49             gpg
 50         decrypt_pillar_delimiter:
 51             :
 52         decrypt_pillar_renderers:
 53             - gpg
 54         default_include:
 55             master.d/*.conf
 56         default_top:
 57             base
 58         discovery:
 59             False
 60         django_auth_path:
 61         django_auth_settings:
 62         drop_messages_signature_fail:
 63             False
 64         dummy_pub:
 65             False
 66         eauth_acl_module:
 67         eauth_tokens:
 68             localfs
 69         enable_gpu_grains:
 70             False
 71         enable_ssh_minions:
 72             False
 73         enforce_mine_cache:
 74             False
 75         engines:
 76         env_order:
 77         event_match_type:
 78             startswith
 79         event_return:
 80         event_return_blacklist:
 81         event_return_queue:
 82             0
 83         event_return_whitelist:
 84         ext_job_cache:
 85         ext_pillar:
 86         extension_modules:
 87             /var/cache/salt/master/extmods
 88         external_auth:
 89             ----------
 90         extmod_blacklist:
 91             ----------
 92         extmod_whitelist:
 93             ----------
 94         failhard:
 95             False
 96         file_buffer_size:
 97             1048576
 98         file_client:
 99             local
100         file_ignore_glob:
101         file_ignore_regex:
102         file_recv:
103             False
104         file_recv_max_size:
105             100
106         file_roots:
107             ----------
108             base:
109                 - /srv/salt
110         fileserver_backend:
111             - roots
112         fileserver_followsymlinks:
113             True
114         fileserver_ignoresymlinks:
115             False
116         fileserver_limit_traversal:
117             False
118         fileserver_verify_config:
119             True
120         gather_job_timeout:
121             10
122         git_pillar_base:
123             master
124         git_pillar_branch:
125             master
126         git_pillar_env:
127         git_pillar_global_lock:
128             True
129         git_pillar_includes:
130             True
131         git_pillar_insecure_auth:
132             False
133         git_pillar_passphrase:
134         git_pillar_password:
135         git_pillar_privkey:
136         git_pillar_pubkey:
137         git_pillar_refspecs:
138             - +refs/heads/*:refs/remotes/origin/*
139             - +refs/tags/*:refs/tags/*
140         git_pillar_root:
141         git_pillar_ssl_verify:
142             True
143         git_pillar_user:
144         git_pillar_verify_config:
145             True
146         gitfs_base:
147             master
148         gitfs_disable_saltenv_mapping:
149             False
150         gitfs_env_blacklist:
151         gitfs_env_whitelist:
152         gitfs_global_lock:
153             True
154         gitfs_insecure_auth:
155             False
156         gitfs_mountpoint:
157         gitfs_passphrase:
158         gitfs_password:
159         gitfs_privkey:
160         gitfs_pubkey:
161         gitfs_ref_types:
162             - branch
163             - tag
164             - sha
165         gitfs_refspecs:
166             - +refs/heads/*:refs/remotes/origin/*
167             - +refs/tags/*:refs/tags/*
168         gitfs_remotes:
169         gitfs_root:
170         gitfs_saltenv:
171         gitfs_saltenv_blacklist:
172         gitfs_saltenv_whitelist:
173         gitfs_ssl_verify:
174             True
175         gitfs_update_interval:
176             60
177         gitfs_user:
178         hash_type:
179             sha256
180         hgfs_base:
181             default
182         hgfs_branch_method:
183             branches
184         hgfs_env_blacklist:
185         hgfs_env_whitelist:
186         hgfs_mountpoint:
187         hgfs_remotes:
188         hgfs_root:
189         hgfs_saltenv_blacklist:
190         hgfs_saltenv_whitelist:
191         hgfs_update_interval:
192             60
193         http_max_body:
194             107374182400
195         http_request_timeout:
196             3600.0
197         id:
198             salt01
199         interface:
200             0.0.0.0
201         ioflo_console_logdir:
202         ioflo_period:
203             0.01
204         ioflo_realtime:
205             True
206         ioflo_verbose:
207             0
208         ipc_mode:
209             ipc
210         ipc_write_buffer:
211             0
212         ipv6:
213             False
214         jinja_env:
215             ----------
216         jinja_lstrip_blocks:
217             False
218         jinja_sls_env:
219             ----------
220         jinja_trim_blocks:
221             False
222         job_cache:
223             True
224         job_cache_store_endtime:
225             False
226         keep_acl_in_token:
227             False
228         keep_jobs:
229             24
230         key_cache:
231         key_logfile:
232             /var/log/salt/key
233         key_pass:
234             None
235         keysize:
236             2048
237         local:
238             True
239         lock_saltenv:
240             False
241         log_datefmt:
242             %H:%M:%S
243         log_datefmt_console:
244             %H:%M:%S
245         log_datefmt_logfile:
246             %Y-%m-%d %H:%M:%S
247         log_file:
248             /var/log/salt/master
249         log_fmt_console:
250             [%(levelname)-8s] %(message)s
251         log_fmt_logfile:
252             %(asctime)s,%(msecs)03d [%(name)-17s:%(lineno)-4d][%(levelname)-8s][%(process)d] %(message)s
253         log_granular_levels:
254             ----------
255         log_level:
256             warning
257         log_level_logfile:
258             warning
259         log_rotate_backup_count:
260             0
261         log_rotate_max_bytes:
262             0
263         loop_interval:
264             60
265         maintenance_floscript:
266             /usr/lib/python2.7/site-packages/salt/daemons/flo/maint.flo
267         master_floscript:
268             /usr/lib/python2.7/site-packages/salt/daemons/flo/master.flo
269         master_job_cache:
270             local_cache
271         master_pubkey_signature:
272             master_pubkey_signature
273         master_roots:
274             ----------
275             base:
276                 - /srv/salt-master
277         master_sign_key_name:
278             master_sign
279         master_sign_pubkey:
280             False
281         master_stats:
282             False
283         master_stats_event_iter:
284             60
285         master_tops:
286             ----------
287         master_use_pubkey_signature:
288             False
289         max_event_size:
290             1048576
291         max_minions:
292             0
293         max_open_files:
294             100000
295         memcache_debug:
296             False
297         memcache_expire_seconds:
298             0
299         memcache_full_cleanup:
300             False
301         memcache_max_items:
302             1024
303         min_extra_mods:
304         minion_data_cache:
305             True
306         minion_data_cache_events:
307             True
308         minionfs_blacklist:
309         minionfs_env:
310             base
311         minionfs_mountpoint:
312         minionfs_update_interval:
313             60
314         minionfs_whitelist:
315         module_dirs:
316         nodegroups:
317             ----------
318         on_demand_ext_pillar:
319             - libvirt
320             - virtkey
321         open_mode:
322             False
323         optimization_order:
324             - 0
325             - 1
326             - 2
327         order_masters:
328             False
329         outputter_dirs:
330         peer:
331             ----------
332         permissive_acl:
333             False
334         permissive_pki_access:
335             False
336         pidfile:
337             /var/run/salt-master.pid
338         pillar_cache:
339             False
340         pillar_cache_backend:
341             disk
342         pillar_cache_ttl:
343             3600
344         pillar_includes_override_sls:
345             False
346         pillar_merge_lists:
347             False
348         pillar_opts:
349             True
350         pillar_roots:
351             ----------
352             base:
353                 - /srv/pillar
354                 - /srv/spm/pillar
355         pillar_safe_render_error:
356             True
357         pillar_source_merging_strategy:
358             smart
359         pillar_version:
360             2
361         pillarenv:
362             None
363         ping_on_rotate:
364             False
365         pki_dir:
366             /etc/salt/pki/master
367         preserve_minion_cache:
368             False
369         pub_hwm:
370             1000
371         publish_port:
372             4505
373         publish_session:
374             86400
375         publisher_acl:
376             ----------
377         publisher_acl_blacklist:
378             ----------
379         python2_bin:
380             python2
381         python3_bin:
382             python3
登录查看全部

参与评论

评论留言

还没有评论留言,赶紧来抢楼吧~~

手机查看

返回顶部

给这篇文章打个标签吧~

棒极了 糟糕透顶 好文章 PHP JAVA JS 小程序 Python SEO MySql 确认