Class: Kitchen::Driver::SSHBase
- Inherits:
-
Object
- Object
- Kitchen::Driver::SSHBase
- Defined in:
- lib/kitchen/provisioner/chef_zero_nodes.rb
Instance Method Summary collapse
-
#converge(state) ⇒ Object
ChefZeroNodes needs to access to legacy_ssh_base_converge method used by some drivers like kithen-vz.
Instance Method Details
#converge(state) ⇒ Object
ChefZeroNodes needs to access to legacy_ssh_base_converge method used by some drivers like kithen-vz. This method add additional command after chef_client run complete.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/kitchen/provisioner/chef_zero_nodes.rb', line 42 def converge(state) provisioner = instance.provisioner provisioner.create_sandbox sandbox_dirs = Util.list_directory(provisioner.sandbox_path) instance.transport.connection(backcompat_merged_state(state)) do |conn| conn.execute(env_cmd(provisioner.install_command)) conn.execute(env_cmd(provisioner.init_command)) info("Transferring files to #{instance.to_str}") conn.upload(sandbox_dirs, provisioner[:root_path]) debug('Transfer complete') conn.execute(env_cmd(provisioner.prepare_command)) conn.execute(env_cmd(provisioner.run_command)) # Change perms for node json object, by default it has 600 perms int_node_file = windows_os? ? provisioner.win_int_node_file : provisioner.unix_int_node_file info("Change permissions for #{int_node_file}") conn.execute(env_cmd("sudo chmod +r #{int_node_file}")) # Download node json object generated by chef_client info("Transferring #{int_node_file} " \ "from instance to #{provisioner.ext_node_file}") conn.execute(env_cmd(conn.download(int_node_file, provisioner.ext_node_file))) debug('Transfer complete') end rescue Kitchen::Transport::TransportFailed => ex raise ActionFailed, ex. ensure instance.provisioner.cleanup_sandbox end |