avantra.core.sapsystem (24.0.0) — module

manage SAP systems in Avantra

| "added in version" 23.0.0 of avantra.core"

Authors: Michael Szediwy (@avantra-mis)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install avantra.core:==24.0.0


Add to requirements.yml

  collections:
    - name: avantra.core
      version: 24.0.0

Description

You can create, delete or update SAP systems in Avantra.

Start, stop, restart SAP systems using Avantra functionality.

A SAP system is always identified with its B(Unified SAP SID) and customer name.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete SAP system from Avantra if it exists
  avantra.core.sapsystem:
    exists_state: absent
    unified_sap_sid: "UNF_SAP_SYS"
    customer_name: "mis"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create SAP system if it doesn't exist
  avantra.core.sapsystem:
    exists_state: present
    unified_sap_sid: "AVA_EXA"
    real_sap_sid: "EXA"
    customer_name: "Example Customer"
    system_role: "Development"
    timezone: "UTC"
    monitoring: true
    notes: "Some notes"
    description: "A description"
    database:
      monitoring_server_system_id: 253
      host: "golf"
      name: "EXA"
      port: 12345
    credentials:
      # SAP control user
      avantra.sapControl:
        cred_type: sap_control
        username: <user>
        password: <password>
      # ABAP user
      avantra.defaultRfcUser:
        cred_type: rfc
        username: <user>
        password: <password>
        client: 000
      # ABAP database user
      avantra.abapDbSchema:
        cred_type: basic
        username: <user>
        password: <password>
      # J2EE user
      avantra.j2eeUser:
        cred_type: basic
        username: <user>
        password: <password>
      # J2EE database user
      avantra.javaDbSchema:
        cred_type: basic
        username: <user>
        password: <password>
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Restart the SAP system
  avantra.core.sapsystem:
    exists_state: present
    run_state: restarted
    run_options:
      execution_name: "Restart the AVA_EXE SAP system"
    unified_sap_sid: "AVA_EXA"
    customer_name: Avantra
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Restart the SAP system with its database and servers
  avantra.core.sapsystem:
    exists_state: present
    run_state: restarted
    run_options:
      execution_name: "Restart the AVA_EXE SAP system with its database and servers"
      with_database: true
      with_servers: true
    unified_sap_sid: "AVA_EXA"
    customer_name: Avantra

Inputs

    
notes:
    description: The notes for the SAP system.
    required: false
    type: str

token:
    description: 'The token used to authenticate during the task execution. A token can
      be fetched with the M(avantra.core.login) module. If I(token) is defined I(avantra_api_user)
      and I(avantra_api_password) are not necessary.

      '
    required: false
    type: str

database:
    description: Configures the database detail for the SAP system.
    required: false
    suboptions:
      host:
        description:
        - Defines the database host.
        required: false
        type: str
      monitoring_server_system_id:
        description:
        - The system ID of the server monitoring the database.
        required: false
        type: str
      name:
        description:
        - Configures the database name.
        required: false
        type: str
      port:
        description:
        - Defines the database port.
        required: false
        type: str
    type: dict

timezone:
    description:
    - Configures the timezone for the system.
    required: false
    type: str

run_state:
    choices:
    - started
    - stopped
    - restarted
    description:
    - If C(started) and the current state is C(run_state=stopped) or C(run_state=unknown)
      the SAP system will be started.
    - If C(stopped) and the current state is C(run_state=started) or C(run_state=unknown)
      the SAP system will be started.
    - If C(restarted) the SAP system will be restarted.
    - B(Note:) if C(exists_state=absent) and the SAP system exists the run state change
      will be applied before the SAP system is deleted. If C(exists_state=present) the
      run state change will be executed after the SAP system has been created.
    type: str

monitoring:
    description:
    - Should the monitoring be turned on or off.
    - This applies only to C(exists_state=present).
    - For C(exists_state=absent) this parameter will be ignored.
    required: false
    type: bool

credentials:
    description:
    - Add credentials to this SAP system. See the examples for more information on how
      to set the different credential types. The key for the child objects is one of the
      credential keys found in Avantra.
    - We highly recommend to use Ansible Vaults to protect you sensitive content.
    required: false
    type: dict

description:
    description: The description for the SAP system.
    required: false
    type: str

run_options:
    default: {}
    description:
    - Allows you to configure the behaviour of the run_state changes.
    required: false
    suboptions:
      always_execute:
        default: false
        description:
        - Ignore the current state and just execute the start/stop/restart.
        required: false
        type: bool
      check_db_state:
        default: true
        description:
        - If C(with_database=true) then the task checks the database state before starting
          SAP system (only for Linux, uses R3Trans).
        required: false
        type: bool
      execution_name:
        description:
        - Defines a name for the action to be executed.
        required: false
        type: str
      force_stop:
        default: true
        description:
        - Avantra checks for known running applications (ie. applications with monitoring
          turned on) and cancels a stop if some are found. With C(force_stop=true), the
          server will be stopped in any case.
        required: false
        type: bool
      monitoring:
        description:
        - If C(run_state=started) this parameter defaults to true.
        - If C(run_state=stopped) this parameter defaults to false.
        - If C(run_state=restarted) this parameter is ignored.
        type: bool
      restart_wait_seconds:
        default: 5
        description:
        - Defines the wait time in seconds after a stop before start process is started.
        required: false
        type: int
      send_user_info:
        default: false
        description:
        - Send a message to all users logged in with SAPGUI. Use this option together
          with C(soft_timeout) setting.
        required: false
        type: bool
      soft_timeout:
        default: 0
        description:
        - Defines the soft timeout a timeout in seconds for a soft shutdown via SIGQUIT,
          if the timeout expires a hard shutdown is used. After the soft timeout, logged
          in users are automatically logged out.
        required: false
        type: int
      wait_seconds:
        default: 60
        description:
        - Defines the wait time in seconds after a server start before executing next
          steps.
        required: false
        type: int
      with_database:
        default: false
        description: Starts/Stops/Restarts the SAP System including the database.
        required: false
        type: bool
      with_servers:
        default: false
        description:
        - Starts/Stops/Restarts all cloud servers, the SAP database (full) and the SAP
          System.
        - If C(with_servers=true) then C(with_database=true) is needed as well and C(with_system_db_if_hana)
          must not be true.
        required: false
        type: bool
      with_system_db_if_hana:
        default: false
        description:
        - Starts/Stops/Restarts the SAP HANA System DB, all HANA tenants and the SAP System.
        - If C(with_system_db_if_hana=true) then C(with_database=true) is needed as well
          and C(with_server) must not be true.
        required: false
        type: bool
    type: dict

system_role:
    description:
    - Configures the system role.
    - If C(exists_state=present) and the system has to be created this parameter is mandatory.
    - 'By default the following roles are available: C(Consolidation), C(Development),
      C(Education), C(Integration), C(Production), C(Quality assurance), C(Sandpit), C(Test).
      The can be customized in Avantra.'
    required: false
    type: str

exists_state:
    choices:
    - present
    - absent
    default: present
    description:
    - If C(present) the SAP system with the given parameter is created in case is does
      not exist or modified in case it exists.
    - If C(absent) the SAP system identified by the I(unified_sap_sid) and I(customer_name)
      is deleted if it exists.
    required: false
    type: str

real_sap_sid:
    description:
    - The B(Real SAP SID) of the SAP system. Maximum allowed length is 3 characters.
    - If C(exists_state=present) and the SAP system has to be created this parameter is
      mandatory.
    required: false
    type: str

customer_name:
    description:
    - A customer name known by Avantra. Together with the I(unified_sap_sid) parameter
      it identifies a SAP system.
    required: true
    type: str

avantra_api_url:
    description:
    - A valid URL pointing to an Avantra UI.
    - For example C(https://avantra-ui/xn)
    required: true
    type: str

unified_sap_sid:
    description:
    - The B(Unified SAP SID) of a SAP system. Together with the I(customer_name) parameter
      it identifies a SAP system.
    required: true
    type: str

application_type:
    description: The application type (one of the defined in the customizations).
    required: false
    type: str

avantra_api_user:
    description:
    - Valid Avantra user principal.
    required: false
    type: str

custom_attributes:
    default: {}
    description:
    - Define custom attributes for the monitored system as key value pairs. See U(https://docs.avantra.com/product-guide/latest/avantra/custom-attributes.html)
      for an explanation.
    required: false
    type: dict

avantra_api_password:
    description:
    - The password or API key for the selected Avantra user.
    - We highly recommend to use Ansible Vaults to protect you sensitive content.
    required: false
    type: str

remote_monitoring_entry_point:
    description: Configures the remote entrypoint for agentless SAP system.
    required: false
    type: str

remote_monitoring_server_system_id:
    description: Configures the server monitoring the remote SAP system.
    required: false
    type: str

Outputs

sap_system:
  description:
  - If C(exists_state=present) and the SAP system can be identified the system information
    is returned.
  returned: present
  type: dict

See also