avantra.core.server (24.0.0) — module

manage Avantra servers

| "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 servers in Avantra.

Start, stop, restart servers using Avantra functionality.

A server is always identified with its C(server_name) and C(customer_name).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Server if it doesn't exist
  avantra.core.server:
    exists: present
    server_name: "agent_5432"
    customer_name: "Avantra 1"
    fqdn_or_ip_address: "host5432"
    system_role: "Test"
    host_aliases:
      - host-5432
    credentials:
      avantra.basic:
        cred_type: basic
        username: <username>
        password: <password>
      avantra.abc:
        cred_type: ssh
        username: <username>
        password: <password>
        hostname: home
        port: 4321
        config:
          ssh_option1: <value>
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Start an existing server
- name: Start Server
  avantra.core.server:
    server_name: "agent_54323"
    customer_name: "Avantra 1"
    run_state: started
    run_options:
      always_execute: true

Inputs

    
notes:
    description: The notes for the server.
    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

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

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

dns_domain:
    description:
    - Configures the DNS domain for this server.
    - This has to a domain registered in Avantra.
    required: false
    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 server. 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.

      '
    required: false
    type: dict

description:
    description: The description for the server.
    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.
        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
      wait_seconds:
        default: 60
        description:
        - Defines the wait time in seconds after a server start before executing next
          steps.
        required: false
        type: int
    type: dict

server_name:
    description: The name to identify the server.
    required: true
    type: str

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 server with the given parameter is created in case is does not
      exist or modified in case it exists.
    - If C(absent) the server identified by the I(server_name) and I(customer_name) is
      deleted if it exists.
    type: str

host_aliases:
    description: A list of valid host aliases.
    elements: str
    required: false
    type: list

customer_name:
    description: The customer name to identify the server.
    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

application_type:
    description:
    - The application type for this monitored system.
    - More information can be found here U(https://docs.avantra.com/product-guide/latest/avantra/glossary/a.html#application-type).
    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

fqdn_or_ip_address:
    description:
    - Configures how the server can be reached over the network. Can be an IP address
      or a host name.
    - If C(exists_state=present) and the server has to be created this parameter is mandatory.
    required: false
    type: str

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

Outputs

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

See also