Giter Club home page Giter Club logo

Comments (5)

Wabri avatar Wabri commented on August 19, 2024 1

Thanks @rob0d we have already started an internal discussion about the sap_libs and how to handle the maintenance.

from community.sap_operations.

kksat avatar kksat commented on August 19, 2024 1

This is a way to stop all SAP ABAP systems using sap.sap_operations collection
See
https://docs.galaxy.saponrhel.org/
https://galaxy.ansible.com/ui/repo/published/sap/sap_operations/

- name: Stop all ABAP instances on the host
   hosts: <hostname>
   gather_facts: false
   become: true
   become_user: root
   tasks: 
     - name: Get all instances on the host
        sap.sap_operations.host_info
        register: host_info

     - name: Stop all ABAP instances on the host
        sap.sap_operations.system:
           name: ABAP
           state: stopped
           instance_number: "{{ instance_number }}"
         loop: "{{ host_info.instances }}"
         vars:
             instance_number: "{{ item.mSystemNumber }}"

I just types this playbook, please use with caution, GPL3.0-only license and warranty.

python-suds package have to be installed on the host you want to run these modules against (if this is a RHEL system). Any other ways to install suds python package should also work.

Hope that helps

from community.sap_operations.

Wabri avatar Wabri commented on August 19, 2024

Hi @ge87sik I've gone through the code and there is definitely a problem in

community.sap_libs.sap_system_facts:

The problem came from the fact that the module sap_libs.sap_system_facts doesn't take any options with it so the param is an element no known by the task. You can see it here: https://github.com/sap-linuxlab/community.sap_libs/blob/7d8bc0f11c2e1f58da73710e7925f456d011ec0c/plugins/modules/sap_system_facts.py

Regarding the no entry sap_facts the problem came by the fact that sap_facts_register return ansible_facts and not sap_facts.

For now just try to replace sap_facts with ansible_facts and copy-paste the results here, I'll reach out the other developers to understand what is the correction that need to be done here.

Thanks for reporting this 🥇

from community.sap_operations.

rob0d avatar rob0d commented on August 19, 2024

Just to add to this. Even when the parameters are removed from line 90 to allow community.sap_libs.sap_system_facts to work, the role fails further down as the returned values are not as expected by the rest of the code. community.sap_libs.sap_system_facts is not compatible with this role, making it unuseable :(..
This was probably introduced by commit #bfd09a5 ?
I will try to test the code as it was before to see if it works.

from community.sap_operations.

crweller avatar crweller commented on August 19, 2024

Hi all,
I just suffered the same issue and figured out that with some minor changes on the main.yml and prepare.yml it started to work.

roles/sap_control/tasks/prepare.yml

- name: SAP Control
  vars:
    sap_control_execute_sid: "{{ item.SID }}"
    sap_control_execute_type: "{{ item.Type }}"
    sap_control_execute_instance_nr: "{{ item.NR }}"
    sap_control_execute_instance_type: "{{ item.InstanceType }}"
  ansible.builtin.include_tasks: "sapcontrol.yml"
  loop: "{{ sap_facts_register.ansible_facts.sap }}"
  when:
    - "item.InstanceType | lower == sap_type | lower"

Just changed following:

  • the loop to use the dict as it is given by sap_libs module
  • the when condition to use the result from InstanceType instead of Type and put both to lower case
  • in the vars change item.InstanceNumber to item.Nr

See the screenshots:

diff_main_yml
main.yml

diff_prepare_yml
prepare.yml

For my situation that worked.

Let me know what you think.
Id' be glad if you consider to use my solution.

Cheers,
Rainer

from community.sap_operations.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.