Re: aarch64 conditional ansible stanza

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 07/04/2016 15:58, Thierry Delamare wrote:
> 
> 
> On 04/07/2016 08:46 AM, Loic Dachary wrote:
>> Hi Thierry,
>>
>> In order to only install a template on architectures that are not aarch64, I changed
>>
>> - name: Add sources list
>>    template:
>>      dest: /etc/apt/sources.list
>>      src: "../../templates/apt/sources.list.{{ ansible_distribution_release | lower }}"
>>      owner: root
>>      group: root
>>      mode: 0644
>>    register: sources
>>
>> into
>>
>> - name: Add sources list
>>    template:
>>      dest: /etc/apt/sources.list
>>      src: "../../templates/apt/sources.list.{{ ansible_distribution_release | lower }}"
>>      owner: root
>>      group: root
>>      mode: 0644
>>    register: sources
>>    when: {{ansible_architecture}} != aarch64
>>
>> Is there a better way to do that ?
> Bonjour Loic,
> 
> Using when statement is the correct way to add conditions to a task,
> but don't forget that the when clause contains a Jinja2 expression (not like a module argument),
> Thus the correct expression should rather be « when: ansible_architecture != 'aarch64' ».

Indeed, the previous attempt failed :-) Here is a more elaborate version that also excludes some packages that are not available in the aarch64 repositories. How does that look ?

https://github.com/ceph/ceph-cm-ansible/pull/224/commits/80e1cb2f3688393f4238268a543e6c3ab19bae75

-- 
Loïc Dachary, Artisan Logiciel Libre
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux