Johannes Kastl [23.05.2016 19:16]:
> Dear all,
> 
> does the zypper module combine all calls made with with_items into on
> single command like the yum module does? I guess not...
> 
> Target Host is a VM with openSUSE Leap 42.1
> 
> I want to install rsyslog, which conflicts with systemd-logger (whose
> only purpose is to provide an explanation why it conflicts... ;-) ).
> So the solution is to install rsyslog and uninstall systemd-logger in
> on call. On the cli I would do:
> 
> sudo zypper install rsyslog -systemd-logger
> 
> I tried to do the same with the zypper module:
> 
>> zypper: name="{{ item.name }}" state="{{ item.state }}"                      
>>                                                                              
>>                       
>> with_items:                                                                  
>>                                                                              
>>                       
>>   - name: rsyslog                                                            
>>                                                                              
>>                       
>>     state: latest                                                            
>>                                                                              
>>                       
>>   - name: systemd-logger                                                     
>>                                                                              
>>                       
>>     state: absent                                                            
>>                                                                              
>>                       
> 
> But this shows the error I get when I try to just install rsyslog
> manually.
> 
> A task calling zypper via shell works:
>> shell: zypper in -y rsyslog -systemd-logger
> 
> Is this intentional? Did I miss some other way to get the package
> installed without the conflict?
> 
> Johannes
> 

Johannes,

when I look at the Python code, I guess that it is not interpreted as
one command due to the "present" for one item and the "absent" for the
other. I think this splits the call of zypper into one "zypper in" and
one "zypper rm" call. This will fail due to the dependencies.

Can you try
  - name: "-systemd-logger"
    state: present
in your playbook?

Btw, internally the module uses "/usr/bin/zypper --non-interactive",
there is no need for "-y" on the command line if you use that ;)

HTH,
Werner

-- 


-- 
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/dc4ef68e-c5cb-2ce5-95d9-dcc80f2b556e%40ufz.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to