I am trying to sort a list when setting a fact in Ansible as follows:

  - name: Get installed packages
    become: true
    become_method: sudo
    package_facts:
    register: installed

  - name: Set package facts
    set_fact:
      packages: "{{ ansible_facts.packages|dict2items|sort }}"

This works when I run it from the command line, but when I do this within 
Ansible Tower, I get the following error:

Unexpected templating type error occurred on ({{ 
ansible_facts.packages|dict2items|sort }}): '<' not supported between 
instances of 'dict' and 'dict'

I know this isn't a Tower list, but would anyone have any idea why this 
would work in the Ansible CLI but not in Tower?

Thanks,
Harry

-- 
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/132882cc-f901-4ed7-b768-72f052b0645fn%40googlegroups.com.

Reply via email to