| 1 |
How to upgrade cdist |
| 2 |
==================== |
| 3 |
|
| 4 |
Update the git installation |
| 5 |
--------------------------- |
| 6 |
|
| 7 |
To upgrade cdist in the current branch use |
| 8 |
|
| 9 |
.. code-block:: sh |
| 10 |
|
| 11 |
git pull |
| 12 |
|
| 13 |
# Also update the manpages |
| 14 |
make man |
| 15 |
export MANPATH=$MANPATH:$(pwd -P)/doc/man |
| 16 |
|
| 17 |
If you stay on a version branch (i.e. 1.0, 1.1., ...), nothing should break. |
| 18 |
The master branch on the other hand is the development branch and may not be |
| 19 |
working, break your setup or eat the tree in your garden. |
| 20 |
|
| 21 |
Safely upgrading to new versions |
| 22 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 23 |
|
| 24 |
To upgrade to **any** further cdist version, you can take the |
| 25 |
following procedure to do a safe upgrade: |
| 26 |
|
| 27 |
.. code-block:: sh |
| 28 |
|
| 29 |
# Create new branch to try out the update |
| 30 |
git checkout -b upgrade_cdist |
| 31 |
|
| 32 |
# Get latest cdist version in git database |
| 33 |
git fetch -v |
| 34 |
|
| 35 |
# see what will happen on merge - replace |
| 36 |
# master with the branch you plan to merge |
| 37 |
git diff upgrade_cdist..origin/master |
| 38 |
|
| 39 |
# Merge the new version |
| 40 |
git merge origin/master |
| 41 |
|
| 42 |
Now you can ensure all custom types work with the new version. |
| 43 |
Assume that you need to go back to an older version during |
| 44 |
the migration/update, you can do so as follows: |
| 45 |
|
| 46 |
.. code-block:: sh |
| 47 |
|
| 48 |
# commit changes |
| 49 |
git commit -m ... |
| 50 |
|
| 51 |
# go back to original branch |
| 52 |
git checkout master |
| 53 |
|
| 54 |
After that, you can go back and continue the upgrade: |
| 55 |
|
| 56 |
.. code-block:: sh |
| 57 |
|
| 58 |
# git checkout upgrade_cdist |
| 59 |
|
| 60 |
|
| 61 |
Update the python package |
| 62 |
------------------------- |
| 63 |
|
| 64 |
To upgrade to the latest version do |
| 65 |
|
| 66 |
.. code-block:: sh |
| 67 |
|
| 68 |
pip install --upgrade cdist |
| 69 |
|
| 70 |
General update instructions |
| 71 |
--------------------------- |
| 72 |
|
| 73 |
Updating from 3.0 to 3.1 |
| 74 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 75 |
|
| 76 |
The type **\_\_ssh_authorized_keys** now also manages existing keys, |
| 77 |
not only the ones added by cdist. |
| 78 |
|
| 79 |
Updating from 2.3 to 3.0 |
| 80 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 81 |
|
| 82 |
The **changed** attribute of objects has been removed. |
| 83 |
Use `messaging </software/cdist/man/3.0.0/man7/cdist-messaging.html>`_ instead. |
| 84 |
|
| 85 |
Updating from 2.2 to 2.3 |
| 86 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 87 |
|
| 88 |
No incompatibilities. |
| 89 |
|
| 90 |
Updating from 2.1 to 2.2 |
| 91 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 92 |
|
| 93 |
Starting with 2.2, the syntax for requiring a singleton type changed: |
| 94 |
Old format: |
| 95 |
|
| 96 |
.. code-block:: sh |
| 97 |
|
| 98 |
require="__singleton_type/singleton" ... |
| 99 |
|
| 100 |
New format: |
| 101 |
|
| 102 |
.. code-block:: sh |
| 103 |
|
| 104 |
require="__singleton_type" ... |
| 105 |
|
| 106 |
Internally the "singleton" object id was dropped to make life more easy. |
| 107 |
You can probably fix your configuration by running the following code |
| 108 |
snippet (currently untested, please report back if it works for you): |
| 109 |
|
| 110 |
.. code-block:: sh |
| 111 |
|
| 112 |
find ~/.cdist/* -type f -exec sed -i 's,/singleton,,' {} \; |
| 113 |
|
| 114 |
Updating from 2.0 to 2.1 |
| 115 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 116 |
|
| 117 |
Have a look at the update guide for [[2.0 to 2.1|2.0-to-2.1]]. |
| 118 |
|
| 119 |
* Type **\_\_package* and \_\_process** use --state **present** or **absent**. |
| 120 |
The states **removed/installed** and **stopped/running** have been removed. |
| 121 |
Support for the new states is already present in 2.0. |
| 122 |
* Type **\_\_directory**: Parameter --parents and --recursive are now boolean |
| 123 |
The old "yes/no" values need to be removed. |
| 124 |
* Type **\_\_rvm_ruby**: Parameter --default is now boolean |
| 125 |
The old "yes/no" values need to be removed. |
| 126 |
* Type **\_\_rvm_gemset**: Parameter --default is now boolean |
| 127 |
The old "yes/no" values need to be removed. |
| 128 |
* Type **\_\_addifnosuchline** and **\_\_removeline** have been replaced by **\_\_line** |
| 129 |
* The **conf** directory is now located at **cdist/conf**. |
| 130 |
You need to migrate your types, explorers and manifests |
| 131 |
manually to the new location. |
| 132 |
* Replace the variable **\_\_self** by **\_\_object_name** |
| 133 |
Support for the variable **\_\_object_name** is already present in 2.0. |
| 134 |
* The types **\_\_autofs**, **\_\_autofs_map** and **\_\_autofs_reload** have been removed |
| 135 |
(no maintainer, no users) |
| 136 |
* Type **\_\_user**: Parameter --groups removed (use the new \_\_user_groups type) |
| 137 |
* Type **\_\_ssh_authorized_key** has been replaced by more flexible type |
| 138 |
**\_\_ssh_authorized_keys** |
| 139 |
|
| 140 |
Updating from 1.7 to 2.0 |
| 141 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 142 |
|
| 143 |
* Ensure python (>= 3.2) is installed on the source host |
| 144 |
* Use "cdist config host" instead of "cdist-deploy-to host" |
| 145 |
* Use "cdist config -p host1 host2" instead of "cdist-mass-deploy" |
| 146 |
* Use "cdist banner" for fun |
| 147 |
* Use **\_\_object_name** instead of **\_\_self** in manifests |
| 148 |
|
| 149 |
Updating from 1.6 to 1.7 |
| 150 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 151 |
|
| 152 |
* If you used the global explorer **hardware_type**, you need to change |
| 153 |
your code to use **machine** instead. |
| 154 |
|
| 155 |
Updating from 1.5 to 1.6 |
| 156 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 157 |
|
| 158 |
* If you used **\_\_package_apt --preseed**, you need to use the new |
| 159 |
type **\_\_debconf_set_selections** instead. |
| 160 |
* The **\_\_package** types accepted either --state deinstalled or |
| 161 |
--state uninstalled. Starting with 1.6, it was made consistently |
| 162 |
to --state removed. |
| 163 |
|
| 164 |
Updating from 1.3 to 1.5 |
| 165 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 166 |
|
| 167 |
No incompatibilities. |
| 168 |
|
| 169 |
Updating from 1.2 to 1.3 |
| 170 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 171 |
|
| 172 |
Rename **gencode** of every type to **gencode-remote**. |
| 173 |
|
| 174 |
Updating from 1.1 to 1.2 |
| 175 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 176 |
|
| 177 |
No incompatibilities. |
| 178 |
|
| 179 |
Updating from 1.0 to 1.1 |
| 180 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 181 |
|
| 182 |
In 1.1 the type **\_\_file** was split into **\_\_directory**, **\_\_file** and |
| 183 |
**\_\_link**. The parameter **--type** was removed from **\_\_file**. Thus you |
| 184 |
need to replace **\_\_file** calls in your manifests: |
| 185 |
|
| 186 |
* Remove --type from all \_\_file calls |
| 187 |
* If type was symlink, use \_\_link and --type symbolic |
| 188 |
* If type was directory, use \_\_directory |