Re: [ansible-project] Ansible templates. Joining item vars on one line with static text.

2024-08-19 Thread Michael Starling
Thank you both for the suggestions. Much appreciated. On Sun, Aug 18, 2024 at 12:05 PM Vladimir Botka wrote: > On Sun, 18 Aug 2024 15:11:11 +0100 > Will McDonald wrote: > > > There may be more elegant ways to achieve this > > The below declaration should to the job > > seeds: "{{ ansible_pl

[ansible-project] Ansible templates. Joining item vars on one line with static text.

2024-08-18 Thread Michael Starling
Hello. Consider I have this variable list that can contain as little as 1 and up to 4 items. ldapservers: - server1 - server2 Consider this line in my ldap.conf template. URI ldap://{{ ldapservers(' ') }}/ I would like the resulting file to look like this: URI ldap://server1/ ldap:/

[ansible-project] Need a way to append to a line in a file using items

2020-07-16 Thread Michael Starling
Given a line in a file like this simple_allow_groups = access1,access2,access3 I want to be able to use a list of variables and append to that line. simple_allow_groups = access1,access2,access3,access4,access5,access6 I have tried the following code with lineinfile and replace --- - hosts: 's