Chef検証(5) レシピ作成 (Vlan作成)

# レシピ作成

- まず、既存のレシピはこんな構造になっています。

```
inohana@ino-ubuntu:~/chef-repo$ cd cookbooks/
inohana@ino-ubuntu:~/chef-repo/cookbooks$ ls
chef-client  chef-repo  compat_resource  cron  logrotate  ohai  windows

inohana@ino-ubuntu:~/chef-repo/cookbooks$ cd chef-client
inohana@ino-ubuntu:~/chef-repo/cookbooks/chef-client$ ls
attributes    CONTRIBUTING.md  MAINTAINERS.md  README.md  resources
CHANGELOG.md  libraries        metadata.json   recipes    templates

inohana@ino-ubuntu:~/chef-repo/cookbooks/chef-client$ cd recipes
inohana@ino-ubuntu:~/chef-repo/cookbooks/chef-client/recipes$ ls
bsd_service.rb  delete_validation.rb  service.rb          task.rb
config.rb       init_service.rb       smf_service.rb      _unit_test_cloning_resource.rb
cron.rb         launchd_service.rb    src_service.rb      upstart_service.rb
default.rb      runit_service.rb      systemd_service.rb  windows_service.rb

inohana@ino-ubuntu:~/chef-repo/cookbooks/chef-client/recipes$ pwd
/home/inohana/chef-repo/cookbooks/chef-client/recipes
```

- 同じように Cisco のクックブックをダウンロードして Chef Workstation に配置。
    - [cisco/cisco-network-chef-cookbook](https://github.com/cisco/cisco-network-chef-cookbook)
- ここで cookbook の名前を cisco-cookbook にしているのは、metadata.rb に記載されている name が 'cisco-cookbook' になっているからです。
    - [参考：chef事始め 依存関係の解決](http://yosshio0426.hatenadiary.com/entry/2015/02/07/121439)


```
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-cookbook/recipes$ pwd
/home/inohana/chef-repo/cookbooks/cisco-cookbook/recipes

inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-cookbook$ cat metadata.rb
略
name             'cisco-cookbook'
maintainer       'Cisco Systems'
maintainer_email 'partnereng@chef.io'
license          'Apache v2.0'
description      'Installs/Configures Cisco NX-OS devices'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
issues_url       'https://github.com/cisco/cisco-network-chef-cookbook/issues'
source_url       'https://github.com/cisco/cisco-network-chef-cookbook'
supports         'nexus'
supports         'nexus_centos'
version          '1.1.2'
```
- ここにレシピを作ります。

```
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-cookbook/recipes$ ls -la
total 28
drwxr-xr-x  2 root root 4096 Mar 10 18:50 .
drwxr-xr-x 11 root root 4096 Mar 14 04:24 ..
-rw-r--r--  1 root root   95 Mar 10 18:50 cisco_vlan.rb
-rw-r--r--  1 root root 2538 Mar 10 18:50 demo_cleanup.rb
-rw-r--r--  1 root root 6352 Mar 10 18:50 demo_install.rb
-rw-r--r--  1 root root 1438 Mar 10 18:50 ohai_plugins.rb

inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-cookbook/recipes$ pwd
/home/inohana/chef-repo/cookbooks/cisco-cookbook/recipes

# VLAN100を作成するレシピ

inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-cookbook/recipes$ cat cisco_vlan.rb
cisco_vlan '100' do
  action :create
  shutdown true
  state 'active'
  vlan_name 'test01'
end
```

- 一度 Upload 済のレシピを削除するには以下のコマンドを使います。

```
inohana@ino-ubuntu:~/chef-repo$ knife cookbook upload -delete cisco-cookbook
Do you really want to delete cisco-cookbook version 1.1.2? (Y/N) Y
Deleted cookbook[cisco-cookbook version 1.1.2]
```

- 確認。

```
inohana@ino-ubuntu:~/chef-repo$ knife cookbook list
chef-client       7.2.0
chef-repo         0.1.0
compat_resource   12.16.3
cron              4.0.0
logrotate         2.1.0
ohai              5.0.0
windows           2.1.1
```

- Upload

```
inohana@ino-ubuntu:~/chef-repo$ knife cookbook upload cisco-cookbook
```

- レシピを実行。うまくきました。

```
inohana@ino-ubuntu:~/chef-repo$ knife ssh name:chefn9k "sudo chef-client -o 'recipe [cisco-cookbook::cisco_vlan]'" -x chefuser01 -p 2222

chefn9k [2017-03-14T02:36:41+00:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.
chefn9k [2017-03-14T02:36:42+00:00] INFO: Forking chef instance to converge...
chefn9k Starting Chef Client, version 12.19.33
chefn9k [2017-03-14T02:36:42+00:00] INFO: *** Chef 12.19.33 ***
chefn9k [2017-03-14T02:36:42+00:00] INFO: Platform: x86_64-linux

略

chefn9k [2017-03-14T02:36:47+00:00] WARN: /var/chef/cache/cookbooks/cisco-cookbook/files/default/vendor/gems/net_http_unix-0.2.1/lib/net_x/http_unix.rb:35:in `connect_unix': Object#timeout is deprecated, use Timeout.timeout instead.

chefn9k 

chefn9k     - update vlan_name 'VLAN0100' => 'test01'[2017-03-14T02:36:47+00:00] WARN: /var/chef/cache/cookbooks/cisco-cookbook/files/default/vendor/gems/net_http_unix-0.2.1/lib/net_x/http_unix.rb:35:in `connect_unix': Object#timeout is deprecated, use Timeout.timeout instead.

chefn9k [2017-03-14T02:36:47+00:00] WARN: /var/chef/cache/cookbooks/cisco-cookbook/files/default/vendor/gems/net_http_unix-0.2.1/lib/net_x/http_unix.rb:35:in `connect_unix': Object#timeout is deprecated, use Timeout.timeout instead.

chefn9k 

chefn9k     - update shutdown 'false' => 'true'

chefn9k [2017-03-14T02:36:47+00:00] WARN: Skipping final node save because override_runlist was given

chefn9k [2017-03-14T02:36:47+00:00] INFO: Chef Run complete in 3.928143907 seconds

chefn9k [2017-03-14T02:36:47+00:00] INFO: Skipping removal of unused files from the cache

chefn9k 

chefn9k Running handlers:

chefn9k [2017-03-14T02:36:47+00:00] INFO: Running report handlers

chefn9k Running handlers complete

chefn9k [2017-03-14T02:36:47+00:00] INFO: Report handlers complete

chefn9k Chef Client finished, 1/1 resources updated in 05 seconds
```

- N9K に Vlan100 が作成されました。

```
switch# show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Eth1/1, Eth1/2, Eth1/3, Eth1/4
                                                Eth1/5, Eth1/6, Eth1/7, Eth1/8
                                                Eth1/9, Eth1/10, Eth1/11
                                                Eth1/12, Eth1/13, Eth1/14
                                                Eth1/15, Eth1/16, Eth1/17
                                                Eth1/18, Eth1/19, Eth1/20
                                                Eth1/21, Eth1/22, Eth1/23
                                                Eth1/24, Eth1/25, Eth1/26
                                                Eth1/27, Eth1/28, Eth1/29
                                                Eth1/30, Eth1/31, Eth1/32
                                                Eth1/33, Eth1/34, Eth1/35
                                                Eth1/36, Eth1/37, Eth1/38
                                                Eth1/39, Eth1/40, Eth1/41
                                                Eth1/42, Eth1/43, Eth1/44
                                                Eth1/45, Eth1/46, Eth1/47
                                                Eth1/48, Eth1/49, Eth1/50
                                                Eth1/51, Eth1/52, Eth1/53
                                                Eth1/54
100  test01                           act/lshut Eth1/3

VLAN Type         Vlan-mode
---- -----        ----------
1    enet         CE
100  enet         CE

Remote SPAN VLANs
-------------------------------------------------------------------------------

Primary  Secondary  Type             Ports
-------  ---------  ---------------  -------------------------------------------

```

めでたしめでたし。

-----------------------------------------------
## (参考)失敗ログ

- 既存の recipes ディレクトリに vlan_create.rb というファイルを作成してみる。

```
# cookbook と metadata.rb 内の名前が不一致だった。
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$ pwd
/home/inohana/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$

# 既存のレシピ
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$ ls -la
total 28
drwxr-xr-x  2 inohana inohana 4096 Mar 10 16:43 .
drwxr-xr-x 11 inohana inohana 4096 Mar 10 16:37 ..
-rw-r--r--  1 inohana inohana 2538 Mar 10  2017 demo_cleanup.rb
-rw-r--r--  1 inohana inohana 6352 Mar 10  2017 demo_install.rb
-rw-r--r--  1 inohana inohana 1438 Mar 10  2017 ohai_plugins.rb
-rw-rw-r--  1 inohana inohana   95 Mar 10 16:43 vlan_create.rb

# VLAN100を作成するレシピ。

-rw-rw-r--  1 inohana inohana   95 Mar 10 16:43 vlan_create.rb
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$ cat vlan_create.rb

cisco_vlan '100' do
  action :create
  shutdown true
  state 'active'
  vlan_name 'test01'
end
```

- 失敗しました。

```
# コマンドの間違い。指定するのは cisco_vlan ではなく、レシピ名である cisco-cookbook とすべき。

inohana@ino-ubuntu:~/chef-repo$ knife ssh name:chefn9k "sudo chef-client -o 'recipe[cisco_vlan::create]'" -x chefuser01 -p 2222

chefn9k [2017-03-10T15:40:01+00:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.
chefn9k [2017-03-10T15:40:02+00:00] INFO: Forking chef instance to converge...
chefn9k Starting Chef Client, version 12.19.33
chefn9k [2017-03-10T15:40:02+00:00] INFO: *** Chef 12.19.33 ***
chefn9k [2017-03-10T15:40:02+00:00] INFO: Platform: x86_64-linux
chefn9k [2017-03-10T15:40:02+00:00] INFO: Chef-client pid: 3552
chefn9k [2017-03-10T15:40:03+00:00] WARN: Run List override has been provided.
chefn9k [2017-03-10T15:40:03+00:00] WARN: Original Run List: []
chefn9k [2017-03-10T15:40:03+00:00] WARN: Overridden Run List: [recipe[cisco_vlan::create]]
chefn9k [2017-03-10T15:40:03+00:00] INFO: Run List is [recipe[cisco_vlan::create]]
chefn9k [2017-03-10T15:40:03+00:00] INFO: Run List expands to [cisco_vlan::create]
chefn9k [2017-03-10T15:40:03+00:00] INFO: Starting Chef Run for chefn9k
chefn9k [2017-03-10T15:40:03+00:00] INFO: Running start handlers
chefn9k [2017-03-10T15:40:03+00:00] INFO: Start handlers complete.
chefn9k [2017-03-10T15:40:03+00:00] INFO: HTTP Request Returned 404 Not Found:
chefn9k [2017-03-10T15:40:03+00:00] INFO: HTTP Request Returned 404 Not Found:
chefn9k [2017-03-10T15:40:03+00:00] INFO: Error while reporting run start to Data Collector. URL: https://ino-ubuntu.iselab.local/organizations/ise/data-collector Exception: 404 -- 404 "Not Found"  (This is normal if you do not have Chef Automate)
chefn9k resolving cookbooks for run list: ["cisco_vlan::create"]
chefn9k [2017-03-10T15:40:03+00:00] INFO: HTTP Request Returned 412 Precondition Failed: {"message"=>"Run list contains invalid items: no such cookbook cisco_vlan.", "non_existent_cookbooks"=>["cisco_vlan"], "cookbooks_with_no_versions"=>[]}
chefn9k
chefn9k ================================================================================
chefn9k Error Resolving Cookbooks for Run List:
chefn9k ================================================================================
chefn9k
chefn9k Missing Cookbooks:
chefn9k ------------------
chefn9k The following cookbooks are required by the client but don't exist on the server:
chefn9k * cisco_vlan
chefn9k
chefn9k
chefn9k Expanded Run List:
chefn9k ------------------
chefn9k * cisco_vlan::create
chefn9k
chefn9k Platform:
chefn9k ---------
chefn9k x86_64-linux
chefn9k
chefn9k
chefn9k Running handlers:
chefn9k [2017-03-10T15:40:03+00:00] ERROR: Running exception handlers
chefn9k Running handlers complete
chefn9k [2017-03-10T15:40:03+00:00] ERROR: Exception handlers complete
chefn9k Chef Client failed. 0 resources updated in 01 seconds
chefn9k [2017-03-10T15:40:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
chefn9k [2017-03-10T15:40:03+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
chefn9k [2017-03-10T15:40:03+00:00] ERROR: 412 "Precondition Failed"
chefn9k [2017-03-10T15:40:03+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
inohana@ino-ubuntu:~/chef-repo$
```
- Upload してみる。

```
# metadata.rb と名前が異なるので失敗。

inohana@ino-ubuntu:~/chef-repo$ knife cookbook upload -a
Uploading chef-client    [7.2.0]
Uploading chef-repo      [0.1.0]
Uploading cisco-network-chef-cookbook-develop [0.0.0]
Uploading compat_resource [12.16.3]
Uploading cron           [4.0.0]
Uploading logrotate      [2.1.0]
Uploading ohai           [5.0.0]
Uploading windows        [2.1.1]
ERROR: The data in your request was invalid
Response: Field 'metadata.name' invalid
inohana@ino-ubuntu:~/chef-repo$ ls -la
total 28
drwxrwxr-x  5 inohana inohana 4096 Mar 10 04:44 .
drwxr-xr-x  8 root    root    4096 Mar 10 05:09 ..
drwxr-xr-x  3 inohana root    4096 Mar  2 05:01 .chef
drwxrwxr-x 10 inohana inohana 4096 Mar 10 16:35 cookbooks
-rw-rw-r--  1 inohana inohana  486 Mar 10 04:43 .kitchen.yml
-rw-rw-r--  1 inohana inohana   57 Mar 10 04:43 README.md
drwxrwxr-x  3 inohana inohana 4096 Mar 10 04:43 test
inohana@ino-ubuntu:~/chef-repo$
Using username "inohana".
inohana@9.188.52.29's password:
Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Fri Mar 10 17:31:14 JST 2017

  System load:  0.0               Users logged in:     0
  Usage of /:   66.8% of 2.89GB   IP address for eth0: 172.29.150.100
  Memory usage: 68%               IP address for eth1: 172.22.150.100
  Swap usage:   47%               IP address for eth2: 192.168.112.100
  Processes:    198               IP address for eth3: 192.168.100.191

  Graph this data and manage this system at:
    https://landscape.canonical.com/

242 packages can be updated.
0 updates are security updates.

Last login: Fri Mar 10 17:31:14 2017 from 172.29.200.10
inohana@ino-ubuntu:~$ knife ssh name:chefn9k "sudo chef-client -o 'recipe[chef-client::cisco_vlan]'" -x chefuser01 -p 2222
WARNING: No knife configuration file found
WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/client.pem>
ERROR: Your private key could not be loaded from /etc/chef/client.pem
Check your configuration file and ensure that your private key is readable
inohana@ino-ubuntu:~$ cd chef-repo/
inohana@ino-ubuntu:~/chef-repo$ knife ssh name:chefn9k "sudo chef-client -o 'recipe[chef-client::cisco_vlan]'" -x chefuser01 -p 2222
chefn9k [2017-03-10T16:00:49+00:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.
chefn9k [2017-03-10T16:00:50+00:00] INFO: Forking chef instance to converge...
chefn9k Starting Chef Client, version 12.19.33
chefn9k [2017-03-10T16:00:50+00:00] INFO: *** Chef 12.19.33 ***
chefn9k [2017-03-10T16:00:50+00:00] INFO: Platform: x86_64-linux
chefn9k [2017-03-10T16:00:50+00:00] INFO: Chef-client pid: 4030
chefn9k [2017-03-10T16:00:51+00:00] WARN: Run List override has been provided.
chefn9k [2017-03-10T16:00:51+00:00] WARN: Original Run List: []
chefn9k [2017-03-10T16:00:51+00:00] WARN: Overridden Run List: [recipe[chef-client::cisco_vlan]]
chefn9k [2017-03-10T16:00:51+00:00] INFO: Run List is [recipe[chef-client::cisco_vlan]]
chefn9k [2017-03-10T16:00:51+00:00] INFO: Run List expands to [chef-client::cisco_vlan]
chefn9k [2017-03-10T16:00:51+00:00] INFO: Starting Chef Run for chefn9k
chefn9k [2017-03-10T16:00:51+00:00] INFO: Running start handlers
chefn9k [2017-03-10T16:00:51+00:00] INFO: Start handlers complete.
chefn9k [2017-03-10T16:00:51+00:00] INFO: HTTP Request Returned 404 Not Found:
chefn9k [2017-03-10T16:00:51+00:00] INFO: HTTP Request Returned 404 Not Found:
chefn9k [2017-03-10T16:00:51+00:00] INFO: Error while reporting run start to Data Collector. URL: https://ino-ubuntu.iselab.local/organizations/ise/data-collector Exception: 404 -- 404 "Not Found"  (This is normal if you do not have Chef Automate)
chefn9k resolving cookbooks for run list: ["chef-client::cisco_vlan"]
chefn9k [2017-03-10T16:00:51+00:00] INFO: Loading cookbooks [chef-client@7.2.0, cron@4.0.0, logrotate@2.1.0, compat_resource@12.16.3, windows@2.1.1, ohai@5.0.0]
chefn9k [2017-03-10T16:00:51+00:00] INFO: Skipping removal of obsoleted cookbooks from the cache
chefn9k Synchronizing Cookbooks:
chefn9k   - cron (4.0.0)
chefn9k   - chef-client (7.2.0)
chefn9k   - logrotate (2.1.0)
chefn9k   - compat_resource (12.16.3)
chefn9k   - windows (2.1.1)
chefn9k   - ohai (5.0.0)
chefn9k Installing Cookbook Gems:
chefn9k Compiling Cookbooks...
chefn9k
chefn9k ================================================================================
chefn9k Recipe Compile Error
chefn9k ================================================================================
chefn9k
chefn9k Chef::Exceptions::RecipeNotFound
chefn9k --------------------------------
chefn9k could not find recipe cisco_vlan for cookbook chef-client
chefn9k
chefn9k Platform:
chefn9k ---------
chefn9k x86_64-linux
chefn9k
chefn9k
chefn9k Running handlers:
chefn9k [2017-03-10T16:00:52+00:00] ERROR: Running exception handlers
chefn9k Running handlers complete
chefn9k [2017-03-10T16:00:52+00:00] ERROR: Exception handlers complete
chefn9k Chef Client failed. 0 resources updated in 01 seconds
chefn9k [2017-03-10T16:00:52+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
chefn9k [2017-03-10T16:00:52+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
chefn9k [2017-03-10T16:00:52+00:00] ERROR: could not find recipe cisco_vlan for cookbook chef-client
chefn9k [2017-03-10T16:00:52+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
inohana@ino-ubuntu:~/chef-repo$
```


```
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$ ls -la
total 28
drwxr-xr-x  2 inohana inohana 4096 Mar 10 16:43 .
drwxr-xr-x 11 inohana inohana 4096 Mar 10 16:37 ..
-rw-r--r--  1 inohana inohana 2538 Mar 10  2017 demo_cleanup.rb
-rw-r--r--  1 inohana inohana 6352 Mar 10  2017 demo_install.rb
-rw-r--r--  1 inohana inohana 1438 Mar 10  2017 ohai_plugins.rb
-rw-rw-r--  1 inohana inohana   95 Mar 10 16:43 vlan_create.rb
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes
```

- Renameしたけどだめ。

```
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$ mv vlan_create.rb cisco_vlan
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$ ls -la
total 28
drwxr-xr-x  2 inohana inohana 4096 Mar 10 18:01 .
drwxr-xr-x 11 inohana inohana 4096 Mar 10 16:37 ..
-rw-rw-r--  1 inohana inohana   95 Mar 10 16:43 cisco_vlan
-rw-r--r--  1 inohana inohana 2538 Mar 10  2017 demo_cleanup.rb
-rw-r--r--  1 inohana inohana 6352 Mar 10  2017 demo_install.rb
-rw-r--r--  1 inohana inohana 1438 Mar 10  2017 ohai_plugins.rb
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$
inohana@ino-ubuntu:~/chef-repo/cookbooks/cisco-network-chef-cookbook-develop/cisco-network-chef-cookbook-develop/recipes$ cd ~
inohana@ino-ubuntu:~$ cd chef-repo/
inohana@ino-ubuntu:~/chef-repo$ knife ssh name:chefn9k "sudo chef-client -o 'recipe[chef-client::cisco_vlan]'" -x chefuser01 -p 2222
chefn9k [2017-03-10T16:10:10+00:00] WARN: Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.
chefn9k [2017-03-10T16:10:11+00:00] INFO: Forking chef instance to converge...
chefn9k Starting Chef Client, version 12.19.33
chefn9k [2017-03-10T16:10:11+00:00] INFO: *** Chef 12.19.33 ***
chefn9k [2017-03-10T16:10:11+00:00] INFO: Platform: x86_64-linux
chefn9k [2017-03-10T16:10:11+00:00] INFO: Chef-client pid: 4519
chefn9k [2017-03-10T16:10:12+00:00] WARN: Run List override has been provided.
chefn9k [2017-03-10T16:10:12+00:00] WARN: Original Run List: []
chefn9k [2017-03-10T16:10:12+00:00] WARN: Overridden Run List: [recipe[chef-client::cisco_vlan]]
chefn9k [2017-03-10T16:10:12+00:00] INFO: Run List is [recipe[chef-client::cisco_vlan]]
chefn9k [2017-03-10T16:10:12+00:00] INFO: Run List expands to [chef-client::cisco_vlan]
chefn9k [2017-03-10T16:10:12+00:00] INFO: Starting Chef Run for chefn9k
chefn9k [2017-03-10T16:10:12+00:00] INFO: Running start handlers
chefn9k [2017-03-10T16:10:12+00:00] INFO: Start handlers complete.
chefn9k [2017-03-10T16:10:12+00:00] INFO: HTTP Request Returned 404 Not Found:
chefn9k [2017-03-10T16:10:12+00:00] INFO: HTTP Request Returned 404 Not Found:
chefn9k [2017-03-10T16:10:12+00:00] INFO: Error while reporting run start to Data Collector. URL: https://ino-ubuntu.iselab.local/organizations/ise/data-collector Exception: 404 -- 404 "Not Found"  (This is normal if you do not have Chef Automate)
chefn9k resolving cookbooks for run list: ["chef-client::cisco_vlan"]
chefn9k [2017-03-10T16:10:12+00:00] INFO: Loading cookbooks [chef-client@7.2.0, cron@4.0.0, logrotate@2.1.0, compat_resource@12.16.3, windows@2.1.1, ohai@5.0.0]
chefn9k [2017-03-10T16:10:12+00:00] INFO: Skipping removal of obsoleted cookbooks from the cache
chefn9k Synchronizing Cookbooks:
chefn9k   - chef-client (7.2.0)
chefn9k   - cron (4.0.0)
chefn9k   - logrotate (2.1.0)
chefn9k   - compat_resource (12.16.3)
chefn9k   - windows (2.1.1)
chefn9k   - ohai (5.0.0)
chefn9k Installing Cookbook Gems:
chefn9k Compiling Cookbooks...
chefn9k
chefn9k ================================================================================
chefn9k Recipe Compile Error
chefn9k ================================================================================
chefn9k
chefn9k Chef::Exceptions::RecipeNotFound
chefn9k --------------------------------
chefn9k could not find recipe cisco_vlan for cookbook chef-client
chefn9k
chefn9k Platform:
chefn9k ---------
chefn9k x86_64-linux
chefn9k
chefn9k
chefn9k Running handlers:
chefn9k [2017-03-10T16:10:13+00:00] ERROR: Running exception handlers
chefn9k Running handlers complete
chefn9k [2017-03-10T16:10:13+00:00] ERROR: Exception handlers complete
chefn9k Chef Client failed. 0 resources updated in 01 seconds
chefn9k [2017-03-10T16:10:13+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
chefn9k [2017-03-10T16:10:13+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
chefn9k [2017-03-10T16:10:13+00:00] ERROR: could not find recipe cisco_vlan for cookbook chef-client
chefn9k [2017-03-10T16:10:13+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
inohana@ino-ubuntu:~/chef-repo$ ls -la
total 28
drwxrwxr-x  5 inohana inohana 4096 Mar 10 04:44 .
drwxr-xr-x  8 root    root    4096 Mar 10 05:09 ..
drwxr-xr-x  3 inohana root    4096 Mar  2 05:01 .chef
drwxrwxr-x 10 inohana inohana 4096 Mar 10 16:35 cookbooks
-rw-rw-r--  1 inohana inohana  486 Mar 10 04:43 .kitchen.yml
-rw-rw-r--  1 inohana inohana   57 Mar 10 04:43 README.md
drwxrwxr-x  3 inohana inohana 4096 Mar 10 04:43 test
inohana@ino-ubuntu:~/chef-repo$ cd cookbooks/
inohana@ino-ubuntu:~/chef-repo/cookbooks$ ls
chef-client  chef-repo  cisco-network-chef-cookbook-develop  compat_resource  cron  logrotate  ohai  windows
inohana@ino-ubuntu:~/chef-repo/cookbooks$ ls -la
total 40
drwxrwxr-x 10 inohana inohana 4096 Mar 10 16:35 .
drwxrwxr-x  5 inohana inohana 4096 Mar 10 04:44 ..
drwxrwxr-x  7 inohana inohana 4096 Mar 10 04:50 chef-client
drwxrwxr-x  4 inohana inohana 4096 Mar 10 04:43 chef-repo
drwxr-xr-x  3 inohana inohana 4096 Mar 10 16:35 cisco-network-chef-cookbook-develop
drwxrwxr-x  4 inohana inohana 4096 Mar 10 04:50 compat_resource
drwxrwxr-x  8 inohana inohana 4096 Mar 10 04:51 cron
drwxr-xr-x  7 inohana inohana 4096 Jul 22  2016 logrotate
drwxrwxr-x  5 inohana inohana 4096 Mar 10 04:56 ohai
drwxrwxr-x  8 inohana inohana 4096 Mar 10 04:52 windows
inohana@ino-ubuntu:~/chef-repo/cookbooks$
```