【发布时间】:2017-10-26 02:36:43
【问题描述】:
我不太确定 Chef 何时更新资源。这是我运行的命令和得到的响应:
sudo chef-client -zr "recipe[workstation]"
[2017-10-03T14:01:26+00:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 12.14.89
resolving cookbooks for run list: ["workstation"]
[2017-10-03T14:01:28+00:00] WARN: Cookbook 'cookbooks' is empty or entirely chefignored at /home/centos/cookbooks/cookbooks
Synchronizing Cookbooks:
- workstation (0.2.1)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 7 resources
Recipe: workstation::setup
* yum_package[vim-enhanced] action install (up to date)
* yum_package[emacs] action install (up to date)
* yum_package[tree] action install (up to date)
* yum_package[git] action install (up to date)
* yum_package[ntp] action install (up to date)
* template[/etc/motd] action create
- update content in file /etc/motd from c102c5 to e0c53e
--- /etc/motd 2017-09-22 16:41:57.273701730 +0000
+++ /etc/.chef-motd20171003-2405-1ygf6go 2017-10-03 14:01:34.211094244 +0000
@@ -1,7 +1,7 @@
This server is the property of Syed
HOSTNAME: ip-172-31-35-182
IPADRESS: 172.31.35.182
- CPU: 2400.046
+ CPU: 2400.108
MEMORY: 1014976kB
NAME: Syed
- restore selinux security context
* service[ntpd] action enable (up to date)
* service[ntpd] action start
- start service service[ntpd]
Running handlers:
Running handlers complete
Chef Client finished, 2/8 resources updated in 07 seconds
需要明确的是,我是 Chef 的新手,但似乎每当我运行这个 Chef-Client 命令时,结果都会有所不同,但很多时候它告诉我资源已更新,而我不太清楚自己做了什么改变任何东西。任何帮助都会很棒。谢谢。
【问题讨论】:
-
模板中的 CPU 行是什么样的?是否使用了变化的值?