| 98 | Push testbed specific information to the chef server. The {{{deter_user}}} recipes look for this information to get testbed-specific instantiation information, like the name of the boss machine or which file systems to mount. Chef calls these collections of data, "data bags". We first create a named data bag, "testbed-defs" then populate it with the testbed-specific information. |
| 99 | |
| 100 | {{{ |
| 101 | workstation$ cd /local/chef-repo |
| 102 | workstation$ knife data bag create testbed-defs |
| 103 | workstation$ # We only have an emulab-in-emulab data bag defined right now. |
| 104 | workstation$ knife data bag from file testbed-defs data_bags/testbed-defs/eine.json |
| 105 | workstation$ knife data bag show testbed-defs eine |
| 106 | binary_store_path: binaries |
| 107 | bossnode: myboss.eine.deter.isi.deterlab.net |
| 108 | db_conf: |
| 109 | host: myboss.eine.deter.isi.deterlab.net |
| 110 | name: tbdb |
| 111 | user: mysql |
| 112 | fsnode: myops.eine.deter.isi.deterlab.net |
| 113 | fsprojdir: /q/proj |
| 114 | fsuserdir: /q/users |
| 115 | id: eine |
| 116 | node_mounts: |
| 117 | device: myops.eine.deter.isi.deterlab.net:/share |
| 118 | fstype: nfs |
| 119 | mount_point: /share |
| 120 | options: ro |
| 121 | projdir: /proj |
| 122 | scratch: myboss.eine.deter.isi.deterlab.net:8000 |
| 123 | testbed_netmask: 255.255.0.0 |
| 124 | testbed_network: 192.168.0.0 |
| 125 | userdir: /users |
| 126 | usernode: myops.eine.deter.isi.deterlab.net |
| 127 | workstation$ |
| 128 | }}} |
| 129 | |
| 177 | Now we force {{{chef-client}}} to run on the client by sshing to it and running {{{chef-client}}} by hand. The recipes assigned to the node will fail however as we've not installed the mysql2 libraries the recipes need to communicate with the DETER database. If they were installed though, it still would not work as the DETER database is not accessible remotely. |
| 178 | |
| 179 | Thus ends the tutorial. |
| 180 | |
| 181 | If you wanted to take it further, you can run an emulab-in-emulab experiment, install the mysql2 libraries on the client, and re-run {{{chef-client}}} on the client. If run you would see these recipes run in order. |
| 182 | * {{{routing}}}: set default routes and route correctly for control net and data net. |
| 183 | * {{{mounts}}}: look in the appropriate "data bag" for the test bed type the client is running on and mount the file systems found there. See {{{/local/chef-repo/data_bags/testbed-defs/eine.json}}} for a sample emulab-in-emulab testbed-specific configuration. (These testbed specific data bags take the place of the compile time *.DEF files in the testbed source tree.) |
| 184 | |