0

I would like to automate PHP Updates for my Linux Servers with Ansible. Those are SLES so i'm using zypper module for Ansible. The problem is because of a vendor changes in involved zypper is asking me to confirm Solution 1 which is to also update/change vendor for all php modules like this:

Problem: php5-zlib-5.5.14-63.1.x86_64 requires php5 = 5.5.14, but this requirement cannot be provided
 Solution 1: Following actions will be done:
  install php5-zlib-5.6.40-20.1.x86_64 (with vendor change)
    openSUSE  -->  obs://build.opensuse.org/home:illuusio

Is there an option in Ansible to pick the first Solution and automate the whole process? I already tried force: yes but it didn't change anything. I'm searching a clean solution. I could write a bash script, but i would like to accomplish it with ansible.

Lorem ipsum
  • 892
  • 5
  • 15

1 Answers1

1

The zypper module has a allow_vendor_change parameter which can be used for state dist-upgrade.

- name: Perform a dist-upgrade with allow vendor change
  community.general.zypper:
    name: '*'
    state: dist-upgrade
    allow_vendor_change: true

allow_vendor_change: true adds --allow-vendor-change parameter to the zypper command executed by Ansible. I don't know if it is possible to set that parameter to zypper on the command line when upgrading a single package or not. The Ansible zypper module only allows this when doing a full dist upgrade (name: '*').

Henrik Pingel
  • 9,380
  • 2
  • 28
  • 39
  • Unfortunately this doesn't work for upgrading a single package. So i need go with commands inside the playbook. I forgot to mention that i know about this option. – Lorem ipsum Nov 13 '20 at 17:38