On Thu, 18 May 2023 at 15:39, Kathy L <[email protected]> wrote:
> In our playbook, we are making changes to the chronyd.service file. On
> several different Debian devices, that file is in two different locations:
>
> /lib/systemd/system/chronyd.service
> /etc/systemd/system/chronyd.service
>
> We call the location using:
>
> chronyd_systemd[system_distro]
>
> System_distro is something we've defined with the major and minor OS
> versions smashed together (Debian10, CentOS7, etc.)
>
> In the vars/main.yml file we have:
>
> chronyd_systemd:
> Debian10: /etc/systemd/system/chronyd.service
> Debian11: /lib/systemd/system/chronyd.service
>
> Ideally we'd like something like this:
>
> chronyd-systemd:
> Debian11: /lib/systemd/system/chronyd.service OR
> /etc/systemd/system/chronyd.service
>
> How would we go about doing this?
This should expand to what you want (untested):
"{{ chronyd_systemd[ansible_distribution
~ ansible_distribution_major_version] }}"
--
> 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/2e58e6a6-e38b-4a6a-91c6-6f631155c6fan%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/2e58e6a6-e38b-4a6a-91c6-6f631155c6fan%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Sent from Gmail Mobile
--
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/CAF8BbLaBnGu0YZq4EOues7KhoN%2Bswjf_LaHNfsPpdk-%3DBEHURQ%40mail.gmail.com.