If you really don't want to expand all your package names, something like 
this may work for you:

- name: set apache module package prefix
  set_fact: apache_mod_prefix=libapache2-mod-
- name: install additional modules
  apt: pkg="{{ apache_mod_prefix }}{{ modules|join(',' + apache_mod_prefix) 
}}"

(where `modules` is an array of package suffixes)

On Wednesday, 4 December 2013 17:46:36 UTC+2, Patrick Heeney wrote:
>
> For completeness, posted at https://github.com/ansible/ansible/issues/5166
>
> On Wednesday, December 4, 2013 7:51:23 AM UTC-7, Michael DeHaan wrote:
>>
>> Don't prefix it for now and please make sure there is an open ticket, we 
>> can easily template the series prior to listification.
>>
>> The linked commit is, I am pretty sure, not directly related.
>>
>> -- Michael
>>
>> On Dec 3, 2013, at 8:15 PM, James Tanner <[email protected]> wrote:
>>
>> On 12/03/2013 11:08 PM, Patrick Heeney wrote:
>>  
>>  I am using a third party yaml file to load in php packages (the yaml file 
>> can't really change) using a prefix on apt. 
>>
>>  # doesn't work
>>
>> - name: PHP | MAIN | Install php packages - intl1
>>   apt: >
>>     pkg=php5-{{ item }}
>>     state=latest
>>   with_items: 
>>     - cli
>>     - intl
>>     - mcrypt
>>     - curl
>>   sudo: yes
>>
>> # error
>>
>> failed: [localhost] => (item=cli,intl,mcrypt,curl) => {"failed": true, 
>> "item": "cli,intl,mcrypt,curl"}
>> msg: No package matching 'intl' is available
>>
>> # works
>>
>> - name: PHP | MAIN | Install php packages - intl2
>>   apt: >
>>     pkg=php5-{{ item }}
>>     state=latest
>>   with_items: 
>>     - intl
>>     - mcrypt
>>     - curl
>>   sudo: yes
>>
>>  # in a perfect world (works)
>>
>>  - name: PHP | MAIN | Install php packages - intl3
>>   apt: >
>>     pkg={{ item }}
>>     state=latest
>>   with_items: 
>>
>>     - php5-cli
>>
>>     - php5-intl
>>
>>     - php5-mcrypt
>>
>>     - php5-curl
>>
>>   sudo: yes
>>
>> This looks related to: 
>> https://github.com/ansible/ansible/commit/7ac5e462efbc850dd39ce5746accf3012530ed98
>>
>>  -- 
>> 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].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>> One possible solution is to add a pkg_prefix option to the apt and yum 
>> modules.
>>
>>  -- 
>> 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].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9c6f8419-278b-43d3-aca4-84fcfba638ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to