<h1><spanclass="section-number">5. </span>How to upgrade cdist<aclass="headerlink"href="#how-to-upgrade-cdist"title="Permalink to this headline">¶</a></h1>
<sectionid="update-the-git-installation">
<h2><spanclass="section-number">5.1. </span>Update the git installation<aclass="headerlink"href="#update-the-git-installation"title="Permalink to this headline">¶</a></h2>
<p>If you stay on a version branch (i.e. 1.0, 1.1., ...), nothing should break.
The master branch on the other hand is the development branch and may not be
working, break your setup or eat the tree in your garden.</p>
<sectionid="safely-upgrading-to-new-versions">
<h3><spanclass="section-number">5.1.1. </span>Safely upgrading to new versions<aclass="headerlink"href="#safely-upgrading-to-new-versions"title="Permalink to this headline">¶</a></h3>
<p>To upgrade to <strong>any</strong> further cdist version, you can take the
following procedure to do a safe upgrade:</p>
<divclass="highlight-sh notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># Create new branch to try out the update</span>
git checkout -b upgrade_cdist
<spanclass="c1"># Get latest cdist version in git database</span>
git fetch -v
<spanclass="c1"># see what will happen on merge - replace</span>
<spanclass="c1"># master with the branch you plan to merge</span>
git diff upgrade_cdist..origin/master
<spanclass="c1"># Merge the new version</span>
git merge origin/master
</pre></div>
</div>
<p>Now you can ensure all custom types work with the new version.
Assume that you need to go back to an older version during
the migration/update, you can do so as follows:</p>
<h2><spanclass="section-number">5.2. </span>Update the python package<aclass="headerlink"href="#update-the-python-package"title="Permalink to this headline">¶</a></h2>
<h2><spanclass="section-number">5.3. </span>General update instructions<aclass="headerlink"href="#general-update-instructions"title="Permalink to this headline">¶</a></h2>
<sectionid="updating-from-3-0-to-3-1">
<h3><spanclass="section-number">5.3.1. </span>Updating from 3.0 to 3.1<aclass="headerlink"href="#updating-from-3-0-to-3-1"title="Permalink to this headline">¶</a></h3>
<p>The type <strong>__ssh_authorized_keys</strong> now also manages existing keys,
not only the ones added by cdist.</p>
</section>
<sectionid="updating-from-2-3-to-3-0">
<h3><spanclass="section-number">5.3.2. </span>Updating from 2.3 to 3.0<aclass="headerlink"href="#updating-from-2-3-to-3-0"title="Permalink to this headline">¶</a></h3>
<p>The <strong>changed</strong> attribute of objects has been removed.
Use <aclass="reference external"href="/software/cdist/man/3.0.0/man7/cdist-messaging.html">messaging</a> instead.</p>
</section>
<sectionid="updating-from-2-2-to-2-3">
<h3><spanclass="section-number">5.3.3. </span>Updating from 2.2 to 2.3<aclass="headerlink"href="#updating-from-2-2-to-2-3"title="Permalink to this headline">¶</a></h3>
<p>No incompatibilities.</p>
</section>
<sectionid="updating-from-2-1-to-2-2">
<h3><spanclass="section-number">5.3.4. </span>Updating from 2.1 to 2.2<aclass="headerlink"href="#updating-from-2-1-to-2-2"title="Permalink to this headline">¶</a></h3>
<p>Starting with 2.2, the syntax for requiring a singleton type changed:
<p>Internally the "singleton" object id was dropped to make life more easy.
You can probably fix your configuration by running the following code
snippet (currently untested, please report back if it works for you):</p>
<divclass="highlight-sh notranslate"><divclass="highlight"><pre><span></span>find ~/.cdist/* -type f -exec sed -i <spanclass="s1">'s,/singleton,,'</span><spanclass="o">{}</span><spanclass="se">\;</span>
</pre></div>
</div>
</section>
<sectionid="updating-from-2-0-to-2-1">
<h3><spanclass="section-number">5.3.5. </span>Updating from 2.0 to 2.1<aclass="headerlink"href="#updating-from-2-0-to-2-1"title="Permalink to this headline">¶</a></h3>
<p>Have a look at the update guide for [[2.0 to 2.1|2.0-to-2.1]].</p>
<blockquote>
<div><ulclass="simple">
<li><p>Type <strong>__package* and __process</strong> use --state <strong>present</strong> or <strong>absent</strong>.
The states <strong>removed/installed</strong> and <strong>stopped/running</strong> have been removed.
Support for the new states is already present in 2.0.</p></li>
<li><p>Type <strong>__directory</strong>: Parameter --parents and --recursive are now boolean
The old "yes/no" values need to be removed.</p></li>
<li><p>Type <strong>__rvm_ruby</strong>: Parameter --default is now boolean
The old "yes/no" values need to be removed.</p></li>
<li><p>Type <strong>__rvm_gemset</strong>: Parameter --default is now boolean
The old "yes/no" values need to be removed.</p></li>
<li><p>Type <strong>__addifnosuchline</strong> and <strong>__removeline</strong> have been replaced by <strong>__line</strong></p></li>
<li><p>The <strong>conf</strong> directory is now located at <strong>cdist/conf</strong>.
You need to migrate your types, explorers and manifests
manually to the new location.</p></li>
<li><p>Replace the variable <strong>__self</strong> by <strong>__object_name</strong>
Support for the variable <strong>__object_name</strong> is already present in 2.0.</p></li>
<li><p>The types <strong>__autofs</strong>, <strong>__autofs_map</strong> and <strong>__autofs_reload</strong> have been removed
(no maintainer, no users)</p></li>
<li><p>Type <strong>__user</strong>: Parameter --groups removed (use the new __user_groups type)</p></li>
<li><dlclass="simple">
<dt>Type <strong>__ssh_authorized_key</strong> has been replaced by more flexible type</dt><dd><p><strong>__ssh_authorized_keys</strong></p>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
</section>
<sectionid="updating-from-1-7-to-2-0">
<h3><spanclass="section-number">5.3.6. </span>Updating from 1.7 to 2.0<aclass="headerlink"href="#updating-from-1-7-to-2-0"title="Permalink to this headline">¶</a></h3>
<ulclass="simple">
<li><p>Ensure python (>= 3.2) is installed on the source host</p></li>
<li><p>Use "cdist config host" instead of "cdist-deploy-to host"</p></li>
<li><p>Use "cdist config -p host1 host2" instead of "cdist-mass-deploy"</p></li>
<li><p>Use "cdist banner" for fun</p></li>
<li><p>Use <strong>__object_name</strong> instead of <strong>__self</strong> in manifests</p></li>
</ul>
</section>
<sectionid="updating-from-1-6-to-1-7">
<h3><spanclass="section-number">5.3.7. </span>Updating from 1.6 to 1.7<aclass="headerlink"href="#updating-from-1-6-to-1-7"title="Permalink to this headline">¶</a></h3>
<ulclass="simple">
<li><p>If you used the global explorer <strong>hardware_type</strong>, you need to change
your code to use <strong>machine</strong> instead.</p></li>
</ul>
</section>
<sectionid="updating-from-1-5-to-1-6">
<h3><spanclass="section-number">5.3.8. </span>Updating from 1.5 to 1.6<aclass="headerlink"href="#updating-from-1-5-to-1-6"title="Permalink to this headline">¶</a></h3>
<ulclass="simple">
<li><p>If you used <strong>__package_apt --preseed</strong>, you need to use the new
type <strong>__debconf_set_selections</strong> instead.</p></li>
<li><p>The <strong>__package</strong> types accepted either --state deinstalled or
--state uninstalled. Starting with 1.6, it was made consistently
to --state removed.</p></li>
</ul>
</section>
<sectionid="updating-from-1-3-to-1-5">
<h3><spanclass="section-number">5.3.9. </span>Updating from 1.3 to 1.5<aclass="headerlink"href="#updating-from-1-3-to-1-5"title="Permalink to this headline">¶</a></h3>
<p>No incompatibilities.</p>
</section>
<sectionid="updating-from-1-2-to-1-3">
<h3><spanclass="section-number">5.3.10. </span>Updating from 1.2 to 1.3<aclass="headerlink"href="#updating-from-1-2-to-1-3"title="Permalink to this headline">¶</a></h3>
<p>Rename <strong>gencode</strong> of every type to <strong>gencode-remote</strong>.</p>
</section>
<sectionid="updating-from-1-1-to-1-2">
<h3><spanclass="section-number">5.3.11. </span>Updating from 1.1 to 1.2<aclass="headerlink"href="#updating-from-1-1-to-1-2"title="Permalink to this headline">¶</a></h3>
<p>No incompatibilities.</p>
</section>
<sectionid="updating-from-1-0-to-1-1">
<h3><spanclass="section-number">5.3.12. </span>Updating from 1.0 to 1.1<aclass="headerlink"href="#updating-from-1-0-to-1-1"title="Permalink to this headline">¶</a></h3>
<p>In 1.1 the type <strong>__file</strong> was split into <strong>__directory</strong>, <strong>__file</strong> and
<strong>__link</strong>. The parameter <strong>--type</strong> was removed from <strong>__file</strong>. Thus you
need to replace <strong>__file</strong> calls in your manifests:</p>
<blockquote>
<div><ulclass="simple">
<li><p>Remove --type from all __file calls</p></li>
<li><p>If type was symlink, use __link and --type symbolic</p></li>
<li><p>If type was directory, use __directory</p></li>
<ahref="cdist-install.html"class="btn btn-neutral float-left"title="4. How to install cdist"accesskey="p"rel="prev"><spanclass="fa fa-arrow-circle-left"></span> Previous</a>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.