Hi,

Up until recently I’ve been using a bone-headed setup.sh shell script to setup my desktop clients based on Rocky Linux 8 and a heavily customized KDE desktop:

* https://gitlab.com/kikinovak/rocky-8-desktop

I’ve been learning to use Ansible for some time now (with a few false starts) and I’m currently translating this script into Ansible’s way of doing things:

* https://gitlab.com/kikinovak/rocky-8-ansible

In the original setup.sh script I have a replace_menus() function that loops through *.desktop files in /usr/share/applications and other places and replaces some of these with a custom version, but only if they exist in the first place.

I wonder how I could possibly translate this into Ansible code. Here’s what should happen:

1. Loop through all custom desktop entries in the templates/ directory.

2. If the corresponding .desktop file exists in /usr/share/applications, then replace it with the custom version from templates/.

3. If it doesn’t exist, then don’t install the template.

4. In other words: install the template only if the target already exists.

Any idea how I could possibly translate this into Ansible code ?

Cheers from the sunny South of France,

Niki

--
Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Site : https://www.microlinux.fr
Blog : https://blog.microlinux.fr
Mail : [email protected]
Tél. : 04 66 63 10 32
Mob. : 06 51 80 12 12

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2ff4b9ff-4a16-4222-85ae-892460576276%40microlinux.fr.

Reply via email to