automation - Resolving Chef Dependencies -
in lab, managing 20 nodes cluster cobbler , chef. cobbler used os provisioning , basic network settings, working fine expected. can manage several os distributions preseed-based nqa installation , local repo mirroring.
we installed chef server , started managing nodes chef not working expected. issue not being able set node dependencies within chef. our 1 important use case this:
- we setting ceph , openstack on these nodes
- ceph should installed before openstack because openstack uses ceph back-end storage
- ceph monitor should installed before ceph osd because creating osd requires talking monitor
the dependencies between openstack , ceph not matter because dependency in 1 node; installing openstack later resolve issue. however, problem arises dependency between ceph monitor , ceph osd. ceph osd provisioning requires running ceph monitor. therefore, ceph osd recipe should run after ceph mon recipe finishes in node. our current method run "chef-client" in "ceph-osd" node after "chef-client" run finishes in "ceph-mon" node think of hassle. there way set these dependencies in chef nodes provision sequentially according dependencies? if not, there frameworks handles this?
in chef itself, know no method orchestrating (that's not chef job).
a workaround given use case use tags , search.
you monitor recipe tag node @ end (with tag("cephmonitor")
or setting attribute wish search on).
after solr index of chef has catch (usually in minute) , can use search in cephosd recipe can this:
cephmonitor = search(:node,"tags:cephmonitor") || nil return if cephmonitor.nil? [.. rest of cephosd recipe, using cephmonitor['fqdn'] or other attribute node ..]
the same behavior can used avoid trying run openstack recipe until osd has run.
the drawback if take 2 or 3 chef run converged infrastructure.
i've nothing recommend orchestration, zookeeper or consul instead of tags , trigger runs.
rundeck can tage runs on different nodes , aggregate in 1 job.
which best depends on feeling there.
Comments
Post a Comment