我的食谱运作良好,直到它开始安装。我不知道为什么它无法使用bash
资源运行系统重新配置命令。
是否有其他方法可以运行命令
bash 'reconfigure gitlab' do
code <<-EOH
gitlab-ctl reconfigure
EOH
end
除了execute
资源以外,还有其他方法可以运行此命令吗?
Starting Chef Client, version 12.18.31
resolving cookbooks for run list: ["gitlab-setup", "firewalld"]
Synchronizing Cookbooks:
- gitlab-setup (0.1.0)
- firewalld (1.1.5)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 12 resources
Recipe: gitlab-setup::default
* yum_package[curl] action install (up to date)
* yum_package[openssh-server] action install (up to date)
* yum_package[postfix] action install (up to date)
* service[sshd] action enable (up to date)
* service[sshd] action start (up to date)
* service[postfix] action enable (up to date)
* service[postfix] action start (up to date)
* firewalld_port[80/tcp] action add
* execute[add port 80/tcp to zone] action run (skipped due to not_if)
(up to date)
* firewalld_port[443/tcp] action add
* execute[add port 443/tcp to zone] action run (skipped due to not_if)
(up to date)
* yum_repository[gitlab_gitlab-ce] action create
* template[/etc/yum.repos.d/gitlab_gitlab-ce.repo] action create (up to date)
* execute[yum clean metadata gitlab_gitlab-ce] action nothing (skipped due to action :nothing)
* execute[yum-makecache-gitlab_gitlab-ce] action nothing (skipped due to action :nothing)
* ruby_block[yum-cache-reload-gitlab_gitlab-ce] action nothing (skipped due to action :nothing)
(up to date)
* yum_package[gitlab-ce] action install (up to date)
* bash[reconfigure gitlab] action run
================================================================================
Error executing action `run` on resource 'bash[reconfigure gitlab]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20170129-29430-hbdnfx" ----
STDOUT:
STDERR:
---- End output of "bash" "/tmp/chef-script20170129-29430-hbdnfx" ----
Ran "bash" "/tmp/chef-script20170129-29430-hbdnfx" returned 1
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/gitlab-setup/recipes/default.rb
46: bash 'reconfigure gitlab' do
47: code <<-EOH
48: gitlab-ctl reconfigure
49: EOH
50: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/gitlab-setup/recipes/default.rb:46:in `from_file'
bash("reconfigure gitlab") do
action [:run]
retries 0
retry_delay 2
default_guard_interpreter :default
command "reconfigure gitlab"
backup 5
returns 0
code " gitlab-ctl reconfigure\n"
interpreter "bash"
declared_type :bash
cookbook_name "gitlab-setup"
recipe_name "default"
end
Platform:
---------
答案 0 :(得分:0)
最后,我开始知道由于实例中缺少内存,命令gitlab-ctl reconfigure无法执行其操作。我们可以通过两种方式增加它,就像我们使用AWS实例然后增加您的实例类型,如从t2.micro到t2.large等。其他方式就像通过定义增加kitchen.yml文件中的内存 记忆 4096