chef / omnibus-ctl

Provides service control for omnibus packages
Apache License 2.0
23 stars 24 forks source link

Remove old node state before running install #29

Closed alexpop closed 9 years ago

alexpop commented 9 years ago

Similar to this: https://github.com/chef/omnibus-ctl/commit/18dbbb8c697f21f465865b9792cea6149726ab0a

'chef-server-ctl install ...' is storing state in '/opt/opscode/embedded/nodes/'

So, if I run:

[root@ap-local-chef-server-12 chef]# chef-server-ctl install opscode-manage --path /media/sf_mnt_kits/chef
---SNIP---
Recipe: private-chef::add_ons_local
  * yum_package[opscode-manage] action install
---SNIP---
Chef Client finished, 1/1 resources updated in 2.802826526 seconds

Subsequent runs will load the previous state as can be seen from the "node['private_chef']['addons']['packages']" and "node['private_chef']['addons']['path']" attributes:

[root@ap-local-chef-server-12 chef]# head -1 /opt/opscode/version-manifest.txt 
chef-server 12.0.7

[root@ap-local-chef-server-12 chef]# chef-server-ctl install opscode-manage
---SNIP---
[1] pry(#<Chef::Recipe>)> node['private_chef']['addons']['packages']
=> ["opscode-reporting", "opscode-manage"]
[2] pry(#<Chef::Recipe>)> node['private_chef']['addons']['path']
=> "/media/sf_mnt_kits/chef"