ansible facts in lowercase

2,870 views
Skip to first unread message

Vladimir Fess

unread,
Jun 1, 2015, 8:44:29 AM6/1/15
to ansible...@googlegroups.com
Hi there!

I'm newer in ansible. I have one question and hope you'll help me with it.

For example I want add deb:

- name: add webmin deb's for {{ansible_distribution}} {{ansible_distribution_version}} {{ansible_architecture}}
  apt_repository: repo='http://software.virtualmin.com/gpl/debian/ virtualmin-jessie main' state=present
  when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'

but I don't want write this for all distro releases.


In the end I want received some thing like this:

- name: add webmin deb's for {{ansible_distribution}} {{ansible_distribution_version}} {{ansible_architecture}}
  apt_repository: repo='http://software.virtualmin.com/gpl/{{ansible_distribution}}/ virtualmin-{{ansible_distribution_release}} main' state=present
  when: ansible_distribution == 'Debian'

That is doesn't work right, because almost all ansible facts have first letter in uppercase. How I can convert it to lowercase?

Thanks.

Brian Coca

unread,
Jun 1, 2015, 9:58:44 AM6/1/15
to ansible...@googlegroups.com
use the |lower filter



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages