Howto Ansible ucr commit

Hi,
we want to simplify UCS /ucs@school installation with Ansible.
I was able to install the univention Ansible collections and can basically reference it. At least a univention-install command was successful.
Now I want to achieve a change in the .bashrc file and commit the change.
On the command line I would do “ucr commit /etc/bash.bashrc”
How can it be done with Ansible?

If it is a dumb question - I apologize. I’m new to Ansible and univention ansible modules.
Thanks in advance,
Michael

Hi mplan,
that’s interesting indeed.

I never looked at using ansible to configure UCS (as in install/deploy). Ansible works great for all things, updates etc.

However, the UCS udm modules cover only a few options:

Anything else needs to be done through other Ansible commands.

I wonder if you could share what you already know about UCS installation with Ansible? I don’t remember anyone mention this on the forum.

Hello @mplan

yes, this is possible, as we provide an ansible module for UCR:

And this already has a commit option.

So for your example (if the modules are installed) this would result in:

- name: "Commit /etc/bash.bashrc"
  univention.ucs_modules.univention_config_registry:
    commit:
      - "/etc/bash.bashrc”

Hi friedrich,
thanks for your answer. Somehow I didn’t found that info before.
Now it’s clear and almost as assumed :wink:

best regards, Michael

No problem :wink:

Instead of the collection links you used, I recommend the ones univention provides:

https://galaxy.ansible.com/ui/repo/published/univention/ucs_modules/

Hi dzidek23,
thanks for your reply.
As surely read already, I have overseen the commit in the documentation.
With this I can now do the required change.
At the moment there’s not really something to share because I do start after univention base installation and configure additional settings (e.g. checkmk)
I am still afraid to do something with network, maybe this is the next step.
Also executing commands on Primary Directory Node while running playbook for new server was not yet attempted.
This will be the next steps.
A bare metal installation would also be nice, but this is the step after and requires additional software
regards, Michael