<liclass="toctree-l2"><aclass="reference internal"href="#multiple-developers-with-different-trust">25.7. Multiple developers with different trust</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#multiple-developers-with-different-trust">26.7. Multiple developers with different trust</a></li>
<h1><spanclass="section-number">25. </span>Best practice<aclass="headerlink"href="#best-practice"title="Permalink to this headline">¶</a></h1>
<h1><spanclass="section-number">26. </span>Best practice<aclass="headerlink"href="#best-practice"title="Permalink to this headline">¶</a></h1>
<p>Practices used in real environments</p>
<sectionid="passwordless-connections">
<h2><spanclass="section-number">25.1. </span>Passwordless connections<aclass="headerlink"href="#passwordless-connections"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.1. </span>Passwordless connections<aclass="headerlink"href="#passwordless-connections"title="Permalink to this headline">¶</a></h2>
<p>It is recommended to run cdist with public key authentication.
This requires a private/public key pair and the entry
"PermitRootLogin without-password" in the sshd server.
See sshd_config(5) and ssh-keygen(1).</p>
</section>
<sectionid="speeding-up-ssh-connections">
<h2><spanclass="section-number">25.2. </span>Speeding up ssh connections<aclass="headerlink"href="#speeding-up-ssh-connections"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.2. </span>Speeding up ssh connections<aclass="headerlink"href="#speeding-up-ssh-connections"title="Permalink to this headline">¶</a></h2>
<p>When connecting to a new host, the initial delay with ssh connections
is pretty big. As cdist makes many connections to each host successive
connections can be sped up by "sharing of multiple sessions over a single
@ -224,7 +225,7 @@ parallel multiplexed connections this with <cite>MaxSessions N</cite> (N default
for OpenSSH v7.4).</p>
</section>
<sectionid="speeding-up-shell-execution">
<h2><spanclass="section-number">25.3. </span>Speeding up shell execution<aclass="headerlink"href="#speeding-up-shell-execution"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.3. </span>Speeding up shell execution<aclass="headerlink"href="#speeding-up-shell-execution"title="Permalink to this headline">¶</a></h2>
<p>On the source host, ensure that /bin/sh is <em>not</em> bash: bash is quite slow for
script execution. Instead, you could use dash after installing it:</p>
@ -232,7 +233,7 @@ script execution. Instead, you could use dash after installing it:</p>
</div>
</section>
<sectionid="multi-master-or-environment-setups">
<h2><spanclass="section-number">25.4. </span>Multi master or environment setups<aclass="headerlink"href="#multi-master-or-environment-setups"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.4. </span>Multi master or environment setups<aclass="headerlink"href="#multi-master-or-environment-setups"title="Permalink to this headline">¶</a></h2>
<p>If you plan to distribute cdist among servers or use different
environments, you can do so easily with the included version
control git. For instance if you plan to use the typical three
@ -258,7 +259,7 @@ you can clone it multiple times:</p>
</div>
</section>
<sectionid="separating-work-by-groups">
<h2><spanclass="section-number">25.5. </span>Separating work by groups<aclass="headerlink"href="#separating-work-by-groups"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.5. </span>Separating work by groups<aclass="headerlink"href="#separating-work-by-groups"title="Permalink to this headline">¶</a></h2>
<p>If you are working with different groups on one cdist-configuration,
you can delegate to other manifests and have the groups edit only
their manifests. You can use the following snippet in
@ -271,7 +272,7 @@ their manifests. You can use the following snippet in
</div>
</section>
<sectionid="maintaining-multiple-configurations">
<h2><spanclass="section-number">25.6. </span>Maintaining multiple configurations<aclass="headerlink"href="#maintaining-multiple-configurations"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.6. </span>Maintaining multiple configurations<aclass="headerlink"href="#maintaining-multiple-configurations"title="Permalink to this headline">¶</a></h2>
<p>When you need to manage multiple sites with cdist, like company_a, company_b
and private for instance, you can easily use git for this purpose.
Including a possible common base that is reused across the different sites:</p>
@ -330,7 +331,7 @@ Including a possible common base that is reused across the different sites:</p>
<p>Have a look at git-remote(1) to adjust the remote configuration, which allows</p>
<h2><spanclass="section-number">25.7. </span>Multiple developers with different trust<aclass="headerlink"href="#multiple-developers-with-different-trust"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.7. </span>Multiple developers with different trust<aclass="headerlink"href="#multiple-developers-with-different-trust"title="Permalink to this headline">¶</a></h2>
<p>If you are working in an environment that requires different people to
work on the same configuration, but having different privileges, you can
implement this scenario with a gateway host and sudo:</p>
@ -350,7 +351,7 @@ implement this scenario with a gateway host and sudo:</p>
<p>For more details consult sudoers(5)</p>
</section>
<sectionid="templating">
<h2><spanclass="section-number">25.8. </span>Templating<aclass="headerlink"href="#templating"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.8. </span>Templating<aclass="headerlink"href="#templating"title="Permalink to this headline">¶</a></h2>
<ulclass="simple">
<li><p>create directory files/ in your type (convention)</p></li>
<li><p>create the template as an executable file like files/basic.conf.sh, it will output text using shell variables for the values</p></li>
<h2><spanclass="section-number">25.9. </span>Testing a new type<aclass="headerlink"href="#testing-a-new-type"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.9. </span>Testing a new type<aclass="headerlink"href="#testing-a-new-type"title="Permalink to this headline">¶</a></h2>
<p>If you want to test a new type on a node, you can tell cdist to only use an
object of this type: Use the '--initial-manifest' parameter
with - (stdin) as argument and feed object into stdin
@ -407,7 +408,7 @@ of cdist:</p>
</div>
</section>
<sectionid="other-content-in-cdist-repository">
<h2><spanclass="section-number">25.10. </span>Other content in cdist repository<aclass="headerlink"href="#other-content-in-cdist-repository"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.10. </span>Other content in cdist repository<aclass="headerlink"href="#other-content-in-cdist-repository"title="Permalink to this headline">¶</a></h2>
<p>Usually the cdist repository contains all configuration
items. Sometimes you may have additional resources that
you would like to store in your central configuration
@ -420,7 +421,7 @@ and also to store all important files in one
repository.</p>
</section>
<sectionid="notes-on-cdist-order-dependency">
<h2><spanclass="section-number">25.11. </span>Notes on CDIST_ORDER_DEPENDENCY<aclass="headerlink"href="#notes-on-cdist-order-dependency"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">26.11. </span>Notes on CDIST_ORDER_DEPENDENCY<aclass="headerlink"href="#notes-on-cdist-order-dependency"title="Permalink to this headline">¶</a></h2>
<p>With CDIST_ORDER_DEPENDENCY all types are executed in the order in which they
are created in the manifest. The current created object automatically depends
on the previously created object.</p>
@ -428,7 +429,7 @@ on the previously created object.</p>
(like first creating the directory xyz than the file below the directory).</p>
<p>This can be helpful, but one must be aware of its side effects.</p>
<h3><spanclass="section-number">25.11.1. </span>CDIST_ORDER_DEPENDENCY kills parallelization<aclass="headerlink"href="#cdist-order-dependency-kills-parallelization"title="Permalink to this headline">¶</a></h3>
<h3><spanclass="section-number">26.11.1. </span>CDIST_ORDER_DEPENDENCY kills parallelization<aclass="headerlink"href="#cdist-order-dependency-kills-parallelization"title="Permalink to this headline">¶</a></h3>
<p>Suppose you have defined CDIST_ORDER_DEPENDENCY and then, among other things,
you specify creation of three, by nature independent, files.</p>
<h1><spanclass="section-number">27. </span>Local cache overview<aclass="headerlink"href="#local-cache-overview"title="Permalink to this headline">¶</a></h1>
<h1><spanclass="section-number">28. </span>Local cache overview<aclass="headerlink"href="#local-cache-overview"title="Permalink to this headline">¶</a></h1>
<sectionid="description">
<h2><spanclass="section-number">27.1. </span>Description<aclass="headerlink"href="#description"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">28.1. </span>Description<aclass="headerlink"href="#description"title="Permalink to this headline">¶</a></h2>
<p>While executing, cdist stores data to local cache. Currently this feature is
one way only. That means that cdist does not use stored data for future runs.
Anyway, those data can be used for debugging cdist, debugging types and
@ -207,7 +208,7 @@ environment variable.</p>
section in cdist man page.</p>
</section>
<sectionid="cache-overview">
<h2><spanclass="section-number">27.2. </span>Cache overview<aclass="headerlink"href="#cache-overview"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">28.2. </span>Cache overview<aclass="headerlink"href="#cache-overview"title="Permalink to this headline">¶</a></h2>
<p>As noted above each configured host has got its subdirectory in local cache.
Entries in host's cache directory are as follows.</p>
<dlclass="simple">
@ -236,7 +237,7 @@ cdist</p>
</dd>
</dl>
<sectionid="object-cache-overview">
<h3><spanclass="section-number">27.2.1. </span>Object cache overview<aclass="headerlink"href="#object-cache-overview"title="Permalink to this headline">¶</a></h3>
<h3><spanclass="section-number">28.2.1. </span>Object cache overview<aclass="headerlink"href="#object-cache-overview"title="Permalink to this headline">¶</a></h3>
<p>Each object under <strong>object</strong> directory has its own structure.</p>
<dlclass="simple">
<dt>autorequire</dt><dd><p>file containing a list of object auto requirements</p>