Command module and idempotancy.

Hi all,

I’m writing a playbook to install check_mk.

There are packages in the Ubuntu repos but they are old. The developers provide up to date debs, so currently I use the copy module to drop the deb on the target then execute dpkg using the command module with creates=/path/to/installed/exe to give me some idempotancy.

Does this seem a reasonable course of action? It seems to work… Certainly the play shows skipped the second time it’s run. Does anyone do anything ‘cooler’ in the same situation? :slight_smile:

I’m thinking about upgrades, with no package manager, the best I can think of is to store the current output of running the agent with --version in a var file, then when running the playbook run the agent on the target with --version and only do the upgrade if they’re different. I reckon that ought to work…

Has anyone done anything like this?

Hi all,

I'm writing a playbook to install check_mk.

There are packages in the Ubuntu repos but they are old. The developers
provide up to date debs, so currently I use the copy module to drop the deb
on the target then execute dpkg using the command module with
creates=/path/to/installed/exe to give me some idempotancy.

Does this seem a reasonable course of action? It seems to work... Certainly
the play shows skipped the second time it's run. Does anyone do anything
'cooler' in the same situation? :slight_smile:

The 'best' method is create an APT repository on a HTTP-server and add your repository key
so it is trusted and add a file to /etc/apt/sources.list.d and use apt-get to install it.

It might take some time to set up a repository the first time, though.

In all cases the package will need to be named like 0.9.7.7irvine1 so it does not clash
on upgrades.

0.9.7.7irvine1 is considered a higher version than 0.9.7.7 by apt/dpkg

+1 to the repo!

reprepo can be used to setup your personal repository; see:

http://ianlawrence.info/random-stuff/setting-up-a-personal-debian-repository

as a reference.

That's really helpful, thanks very much!