apache - Unable to install httpd service on chef client(node) -
i new chef , following "learning chef" book "o'riely" learn chef basics. in chapter 07 have described install httpd service on chef client(node) chef host using cookbook.
this how .kitchen.yaml file looks :
--- driver: name: vagrant provisioner: name: chef_zero platforms: - name: centos_apache driver: box: learningchef/centos65 boxurl: learningchef/centos65 suites: - name: default run_list: - recipe[my_apache::default] attributes: the recipe installing httpd service looks :
# # cookbook name:: my_apache # recipe:: default # # copyright (c) 2015 authors, rights reserved. # yum_package 'httpd' source "/home/vipul/downloads/httpd-2.2.15-39.el6.centos.x86_64.rpm" action :install end and log after executing command "kitchen converge"
-----> starting kitchen (v1.4.0) -----> converging <default-centos-apache>... preparing files transfer preparing dna.json preparing current project directory cookbook removing non-cookbook files before transfer preparing validation.pem preparing client.rb -----> chef omnibus installation detected (install if missing) transferring files <default-centos-apache> starting chef client, version 12.4.0 [2015-07-08t12:56:06+00:00] warn: child name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json , /tmp/kitchen/dna.json resolving cookbooks run list: ["my_apache::default"] synchronizing cookbooks: - my_apache compiling cookbooks... converging 1 resources recipe: my_apache::default ================================================================================ error executing action `install` on resource 'yum_package[httpd]' ================================================================================ mixlib::shellout::shellcommandfailed ------------------------------------ expected process exit [0], received '1' ---- begin output of /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ---- stdout: [option installonlypkgs] kernel kernel-bigmem installonlypkg(kernel-module) installonlypkg(vm) kernel-enterprise kernel-smp kernel-debug kernel-unsupported kernel-source kernel-devel kernel-pae kernel-pae-debug not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error 14: pycurl error 7 - "failed connect 2a02:2498:1:3d:5054:ff:fed3:e91a: network unreachable" stderr: yum-dump repository error: cannot find valid baseurl repo: base ---- end output of /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ---- ran /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 returned 1 resource declaration: --------------------- # in /tmp/kitchen/cache/cookbooks/my_apache/recipes/default.rb 8: yum_package 'httpd' 9: source "/home/vipul/downloads/httpd-2.2.15-39.el6.centos.x86_64.rpm" 10: action :install 11: end compiled resource: ------------------ # declared in /tmp/kitchen/cache/cookbooks/my_apache/recipes/default.rb:8:in `from_file' yum_package("httpd") action :install retries 0 retry_delay 2 default_guard_interpreter :default package_name "httpd" source "/home/vipul/downloads/httpd-2.2.15-39.el6.centos.x86_64.rpm" flush_cache {:before=>false, :after=>false} declared_type :yum_package cookbook_name "my_apache" recipe_name "default" end running handlers: [2015-07-08t12:56:14+00:00] error: running exception handlers running handlers complete [2015-07-08t12:56:14+00:00] error: exception handlers complete chef client failed. 0 resources updated in 11.596431753 seconds [2015-07-08t12:56:14+00:00] fatal: stacktrace dumped /tmp/kitchen/cache/chef-stacktrace.out [2015-07-08t12:56:14+00:00] error: yum_package[httpd] (my_apache::default line 8) had error: mixlib::shellout::shellcommandfailed: expected process exit [0], received '1' ---- begin output of /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ---- stdout: [option installonlypkgs] kernel kernel-bigmem installonlypkg(kernel-module) installonlypkg(vm) kernel-enterprise kernel-smp kernel-debug kernel-unsupported kernel-source kernel-devel kernel-pae kernel-pae-debug not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error 14: pycurl error 7 - "failed connect 2a02:2498:1:3d:5054:ff:fed3:e91a: network unreachable" stderr: yum-dump repository error: cannot find valid baseurl repo: base ---- end output of /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ---- ran /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 returned 1 [2015-07-08t12:56:14+00:00] fatal: chef::exceptions::childconvergeerror: chef run process exited unsuccessfully (exit code 1) >>>>>> converge failed on instance <default-centos-apache>. >>>>>> please see .kitchen/logs/default-centos-apache.log more details >>>>>> ------exception------- >>>>>> class: kitchen::actionfailed >>>>>> message: ssh exited (1) command: [sh -c ' sudo -e /opt/chef/bin/chef-client --local-mode --config /tmp/kitchen/client.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json --chef-zero-port 8889 '] >>>>>> ---------------------- i want install httpd service using local rpm package. chef client installed on virtual machine. have tried various steps, getting same output always.
update: did yum update in host , client both. after output log changed.. says couldn't find package @ defined source, while present there. please suggest::
-----> starting kitchen (v1.4.0) -----> converging <default-centos-apache>... preparing files transfer preparing dna.json preparing current project directory cookbook removing non-cookbook files before transfer preparing validation.pem preparing client.rb -----> chef omnibus installation detected (install if missing) transferring files <default-centos-apache> starting chef client, version 12.4.0 [2015-07-09t14:16:57+00:00] warn: child name 'dna.json' found in multiple directories: /tmp/kitchen/dna.json , /tmp/kitchen/dna.json resolving cookbooks run list: ["my_apache::default"] synchronizing cookbooks: - my_apache compiling cookbooks... converging 1 resources recipe: my_apache::default ================================================================================ error executing action `install` on resource 'yum_package[httpd]' ================================================================================ chef::exceptions::package ------------------------- package httpd not found: /home/vipul/downloads/httpd-2.2.15-39.el6.centos.x86_64.rpm resource declaration: --------------------- # in /tmp/kitchen/cache/cookbooks/my_apache/recipes/default.rb 8: package "httpd" 9: source "/home/vipul/downloads/httpd-2.2.15-39.el6.centos.x86_64.rpm" 10: action :install 11: end compiled resource: ------------------ # declared in /tmp/kitchen/cache/cookbooks/my_apache/recipes/default.rb:8:in `from_file' yum_package("httpd") action :install retries 0 retry_delay 2 default_guard_interpreter :default package_name "httpd" source "/home/vipul/downloads/httpd-2.2.15-39.el6.centos.x86_64.rpm" flush_cache {:before=>false, :after=>false} declared_type :package cookbook_name "my_apache" recipe_name "default" end running handlers: [2015-07-09t14:17:01+00:00] error: running exception handlers running handlers complete [2015-07-09t14:17:01+00:00] error: exception handlers complete chef client failed. 0 resources updated in 6.822340816 seconds [2015-07-09t14:17:01+00:00] fatal: stacktrace dumped /tmp/kitchen/cache/chef-stacktrace.out [2015-07-09t14:17:01+00:00] error: yum_package[httpd] (my_apache::default line 8) had error: chef::exceptions::package: package httpd not found: /home/vipul/downloads/httpd-2.2.15-39.el6.centos.x86_64.rpm [2015-07-09t14:17:01+00:00] fatal: chef::exceptions::childconvergeerror: chef run process exited unsuccessfully (exit code 1) >>>>>> converge failed on instance <default-centos-apache>. >>>>>> please see .kitchen/logs/default-centos-apache.log more details >>>>>> ------exception------- >>>>>> class: kitchen::actionfailed >>>>>> message: ssh exited (1) command: [sh -c ' sudo -e /opt/chef/bin/chef-client --local-mode --config /tmp/kitchen/client.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json --chef-zero-port 8889 '] >>>>>> ----------------------
might want try following steps outlined here if can't work out proxy/network issues. http://xmodulo.com/how-to-fix-yum-errors-on-centos-rhel-or-fedora.html
regards,
Comments
Post a Comment