Re: [ansible-project] Manipulating part of a custom variable

2018-11-05 Thread John Harmon
Ah, it was the single quotes that I was missing. Thank you. -- 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 ansible-project+unsubscr...@googlegroups.com. To

Re: [ansible-project] Manipulating part of a custom variable

2018-11-05 Thread Kai Stian Olstad
On Monday, 5 November 2018 18:53:55 CET John Harmon wrote: > How can I throw in a custom string? Everything I try seems to fail: > > Working: > newname: "{{ oldname.stdout ~ ansible_date_time.date }}" > Returns: > myserver2018-11-05 > > Desired: > myserver-COPY-2018-11-05 newname: "{{ oldname.s

Re: [ansible-project] Manipulating part of a custom variable

2018-11-05 Thread John Harmon
How can I throw in a custom string? Everything I try seems to fail: Working: newname: "{{ oldname.stdout ~ ansible_date_time.date }}" Returns: myserver2018-11-05 Desired: myserver-COPY-2018-11-05 -- You received this message because you are subscribed to the Google Groups "Ansible Project" gr

Re: [ansible-project] Manipulating part of a custom variable

2018-11-02 Thread John Harmon
Thank you -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@g

Re: [ansible-project] Manipulating part of a custom variable

2018-11-02 Thread Kai Stian Olstad
On Friday, 2 November 2018 22:35:01 CET John Harmon wrote: > Awesome, that works! Using a large number for randomizing didn't even > occur to me. Just one follow-up question. Can you explain to me what the > tilde ~ is doing? Having a hard time finding info on it. It Jinja for concatenate st

Re: [ansible-project] Manipulating part of a custom variable

2018-11-02 Thread John Harmon
Awesome, that works! Using a large number for randomizing didn't even occur to me. Just one follow-up question. Can you explain to me what the tilde ~ is doing? Having a hard time finding info on it. -- You received this message because you are subscribed to the Google Groups "Ansible Proj

Re: [ansible-project] Manipulating part of a custom variable

2018-11-02 Thread Kai Stian Olstad
On Friday, 2 November 2018 21:49:29 CET John Harmon wrote: > I have a variable called 'oldid' set to a value of > '0004fb06b824b442d236a8b7' > > I wish to manipulate it so that I do the following: > 1. strip off the last 12 characters (slicing?) > 2. Re-add 12 more characters that are a

[ansible-project] Manipulating part of a custom variable

2018-11-02 Thread John Harmon
I have a variable called 'oldid' set to a value of '0004fb06b824b442d236a8b7' I wish to manipulate it so that I do the following: 1. strip off the last 12 characters (slicing?) 2. Re-add 12 more characters that are a random numbers between 0-9 Here is what I have, but unsure if I can e