[chef] Re: Re: knife command


Chronological Thread 
  • From: idzzy < >
  • To: , Eduardo Dias < >
  • Subject: [chef] Re: Re: knife command
  • Date: Fri, 4 Jul 2014 09:46:22 +0900

Hello,

"knife cookbook upload" command works.
“knife upload” command does not work.

But I could upload by this command instead.
"knife role from file roles/*.json”

And after that, upload command works.
“knife upload roles”

I’m not sure why once upload files to chef-server, upload command works. 

Anyway Thank you for the reply.

Thanks.

idzzy

On July 4, 2014 at 2:29:15 AM, Eduardo Dias ( "> ) wrote:

go to the folder before the cookbook folder and try:
knife cookbook upload <cookbook_name> -o .
look that has a dot after the -o



2014-07-03 5:39 GMT-03:00 idzzy < " target="_blank"> >:
Hello

I'm trying to upload objects(cookbook, role...etc) from workstation to chef-server.

these knife command works: (knife OBJECT ...)
e.g)
- knife cookbook upload
- knife cookbook list
- knife node list

But these knife command does not work: (knife VERB ...)

- Regarding list command,
if use /, it works. but I don't want to use /. How can I do it?

    # pwd
    /root/chef-repo
    # knife list cookbooks
    ERROR: Attempt to use relative path 'cookbooks' when current directory is outside the repository path
    # knife list /cookbooks
    /cookbooks/chef-client  /cookbooks/cron         /cookbooks/logrotate    /cookbooks/selinux

- Regarding upload command,
following error is displayed. How can I fix this?

    # pwd
    /root/chef-repo
    # knife upload roles
    ERROR: Attempt to use relative path 'role' when current directory is outside the repository path
    # knife upload cookbooks
    ERROR: Attempt to use relative path 'cookbooks' when current directory is outside the repository path

if use /, the responce is back(but no message). but the role is not uploaded to chef-server.

    # knife role list
    
    # knife upload /roles
    # knife role list
    
    #


Although I tried to move knife.rb from /root/.chef/ to /root/chef-repo/.chef/ and modify appropriate path, it was same result.


[version]
chef-server : 11.1.0-1
chef-client in workstation: 11.12.4

[.chef]
# ls -al /root/.chef/
-rw-------. 1 root root  1679 Jun  3 16:18 admin.pem
drwxr-xr-x. 2 root root  4096 Jul  2 18:07 bootstrap/
-rw-------. 1 root root  1679 Jun  3 16:18 chef-validator.pem
-rw-r--r--. 1 root root   610 Jul  3 11:16 knife.rb
-rw-r--r--. 1 root root  1675 Jun  3 17:55 root.pem
drwxr-xr-x. 2 root root 12288 Jun  5 13:48 syntax_check_cache/

[knife.rb]
# cat /root/.chef/knife.rb
log_level                :info
log_location             STDOUT
node_name                'root'
client_key               '/root/.chef/root.pem'
validation_client_name   'chef-validator'
validation_key           '/root/.chef/chef-validator.pem'
chef_server_url          'https://10.32.37.20:443'
syntax_check_cache_path  '/root/.chef/syntax_check_cache'
cookbook_path [ '/root/chef-repo/cookbooks' '/root/chef-repo/site-cookbooks' ]

[chef-repo]
# ls -al /root/chef-repo/
drwxr-xr-x.  8 root root  4096 Jul  2 19:34 .git/
-rw-r--r--.  1 root root   106 Jul  2 19:34 .gitignore
-rw-r--r--.  1 root root    77 Jul  2 19:48 Berksfile
-rw-------.  1 root root   164 Jul  2 20:01 Berksfile.lock
-rw-r--r--.  1 root root 10850 Jul  2 19:34 LICENSE
-rw-r--r--.  1 root root  3510 Jul  2 19:34 README.md
-rw-r--r--.  1 root root  2169 Jul  2 19:34 Rakefile
drwxr-xr-x.  2 root root  4096 Jul  2 19:34 certificates/
-rw-r--r--.  1 root root   156 Jul  2 19:34 chefignore
drwxr-xr-x.  2 root root  4096 Jul  2 19:34 config/
drwxr-xr-x.  6 root root  4096 Jul  2 20:01 cookbooks/
drwxr-xr-x.  2 root root  4096 Jul  2 19:34 data_bags/
drwxr-xr-x.  2 root root  4096 Jul  3 10:05 environments/
drwxr-xr-x.  2 root root  4096 Jul  3 10:05 roles/
drwxr-xr-x.  4 root root  4096 Jul  3 10:06 site-cookbooks/

Thank you.




--

Atenciosamente,

Eduardo



Archive powered by MHonArc 2.6.16.

§