我正在尝试使用chef安装恶意实例上的'ntp'软件包。
这是我的主厨食谱:
package 'ntp' do
action :install
end
我也试过用这个作为我的食谱:
package 'ntp'
这些脚本有什么问题?对于像这样的事情,最好的做法是什么呢?
抱歉,这是一件非常简单的事,我没有得到。我试过谷歌搜索它,但我找不到任何东西。我也尝试过查看厨师文档,但我无法弄明白。
这是我一直得到的错误输出:
-----> Starting Kitchen (v1.19.2)
-----> Converging <default-ubuntu-1604>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 6.3.1...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
Transferring files to <default-ubuntu-1604>
Starting Chef Client, version 13.7.16
resolving cookbooks for run list: ["git_cookbook::default"]
Synchronizing Cookbooks:
- git_cookbook (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: git_cookbook::default
* apt_package[ntp] action install
================================================================================
Error executing action `install` on resource 'apt_package[ntp]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of ["apt-get", "-q", "-y", "install", "ntp=1:4.2.8p4+dfsg-3ubuntu5.7"] ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
libopts25
Suggested packages:
ntp-doc
The following NEW packages will be installed:
libopts25 ntp
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 518 kB/576 kB of archives.
After this operation, 1792 kB of additional disk space will be used.
Err:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 ntp amd64 1:4.2.8p4+dfsg-3ubuntu5.7
404 Not Found [IP: 91.189.88.162 80]
STDERR: E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/n/ntp/ntp_4.2.8p4+dfsg-3ubuntu5.7_amd64.deb 404 Not Found [IP: 91.189.88.162 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
---- End output of ["apt-get", "-q", "-y", "install", "ntp=1:4.2.8p4+dfsg-3ubuntu5.7"] ----
Ran ["apt-get", "-q", "-y", "install", "ntp=1:4.2.8p4+dfsg-3ubuntu5.7"] returned 100
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/git_cookbook/recipes/default.rb
1: package 'ntp' do
2: action :install
3: end
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/git_cookbook/recipes/default.rb:1:in `from_file'
apt_package("ntp") do
package_name "ntp"
action [:install]
default_guard_interpreter :default
declared_type :package
cookbook_name "git_cookbook"
recipe_name "default"
end
System Info:
------------
chef_version=13.7.16
platform=ubuntu
platform_version=16.04
ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
program_name=chef-client worker: ppid=5272;start=06:22:55;
executable=/opt/chef/bin/chef-client
Running handlers:
[2018-02-26T06:23:02+00:00] ERROR: Running exception handlers
Running handlers complete
[2018-02-26T06:23:02+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 07 seconds
[2018-02-26T06:23:02+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2018-02-26T06:23:02+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-02-26T06:23:02+00:00] ERROR: apt_package[ntp] (git_cookbook::default line 1) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of ["apt-get", "-q", "-y", "install", "ntp=1:4.2.8p4+dfsg-3ubuntu5.7"] ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
libopts25
Suggested packages:
ntp-doc
The following NEW packages will be installed:
libopts25 ntp
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 518 kB/576 kB of archives.
After this operation, 1792 kB of additional disk space will be used.
Err:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 ntp amd64 1:4.2.8p4+dfsg-3ubuntu5.7
404 Not Found [IP: 91.189.88.162 80]
STDERR: E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/n/ntp/ntp_4.2.8p4+dfsg-3ubuntu5.7_amd64.deb 404 Not Found [IP: 91.189.88.162 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
---- End output of ["apt-get", "-q", "-y", "install", "ntp=1:4.2.8p4+dfsg-3ubuntu5.7"] ----
Ran ["apt-get", "-q", "-y", "install", "ntp=1:4.2.8p4+dfsg-3ubuntu5.7"] returned 100
[2018-02-26T06:23:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-ubuntu-1604>. Please see .kitchen/logs/default-ubuntu-1604.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration