4

I need to install java on one of my VMs running SUSE Linux using ansible.

Below is the playbook code I am using:

- name: Download Java
  become_user: "{{user}}"
  command: "wget -q -O {{java_archive}} --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' {{download_url}} creates={{java_archive}}"

- name: Fix ownership
  become_user: "{{user}}"
  file: state=directory path={{java_name}} owner={{user}} group={{user}} recurse=yes

- zypper: name={{download_folder}}/jdk-8u5-linux-x64.rpm become_user={{user}} state=present

- name: Clean up
  become_user: "{{user}}"
  file: state=absent path={{java_archive}}

The problem I'm facing is that the installer needs some interactions while installing. How do I automate that? Or there is some other way to achieve this?

interaction screen without ansible

As requested in comments, following message appears when I try to install without ansible.

  • What are those needed interactions? – ctx Mar 18 '17 at 12:02
  • It is throwing an error in XML format with some prompts tags asking questions like Continue?, Abort, retry, ignore? etc. link here is the link to the output that I have received (Raw unedited/unformatted) – Abhishek Sharma Mar 18 '17 at 12:45
  • Please capture the interaction prompts on a real shell (without ansible) and put then into your question. You probably have to do some work before you can run this playbook. – ctx Mar 18 '17 at 13:06
1

From ansible-doc zypper:

- oldpackage
        Adds `--oldpackage' option to `zypper'. Allows to downgrade packages
        with less side-effects than force. This is implied as soon as a
        version is specified as part of the package name.
        (Choices: yes, no)[Default: no]

Try with oldpackage=yes and if it doesn't help you could use the more aggressive force=yes option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.