senhasegura.pam.senhasegura_device (1.0.0) — module

Module for management devices in senhasegura PAM

Authors: Lucas Fraga (@lfraga)

Install collection

Install with ansible-galaxy collection install senhasegura.pam:==1.0.0


Add to requirements.yml

  collections:
    - name: senhasegura.pam
      version: 1.0.0

Description

Authenticates in senhasegura PAM to manage devices

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Absent example-001 device
  senhasegura.pam.senhasegura_device:
    state: absent
    hostname: example-001
    address: 192.168.10.10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Ensure example-002 device
  senhasegura.pam.senhasegura_device:
    state: present
    hostname: example-002
    address: 192.168.10.20
    type: Server
    vendor: Red Hat
    model: Red Hat Enterprise Linux
    site: Cloud
    connectivities: ['SSH:22', 'HTTPS:443']
    tags: ['rhel', 'cloud']
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure windows-001 device
  senhasegura.pam.senhasegura_device:
    state: present
    hostname: windows-001
    address: 192.168.10.30
    type: Server
    vendor: Microsoft
    model: Windows Server
    site: On-premises
    connectivities: ['RDP:3389']
    tags: ['windows', 'domain']
    domain: CORP

Inputs

    
site:
    description:
    - Site of device.
    - Required when state is present
    type: str

tags:
    description:
    - The device tags.
    type: list

type:
    description:
    - Type of device, if non-existent, will be created.
    - Required when state is present
    type: str

model:
    description:
    - Model of device, if non-existent, will be created.
    - Required when state is present
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether the device should exist or not,
    type: str

domain:
    description:
    - The device domain.
    type: str

vendor:
    description:
    - Vendor of device, if non-existent, will be created.
    - Required when state is present
    type: str

address:
    description: IP or DNS
    required: true
    type: str

hostname:
    description:
    - Hostname of device
    required: true
    type: str

client_id:
    description:
    - A2A OAuth2 client_id, SENHASEGURA_CLIENT_ID environment variable may also be used
    type: str

system_url:
    description:
    - senhasegura's environment URL used for authentication, SENHASEGURA_URL environment
      variable may also be used
    type: str

client_secret:
    description:
    - A2A OAuth2 client_secret, SENHASEGURA_CLIENT_SECRET environment variable may also
      be used
    type: str

connectivities:
    description:
    - The connectivity protocols on device in format <Protocol>:<Port>
    - Example 'SSH:22'
    type: list

validate_certs:
    description:
    - Whether to validate or not the HTTPS certificate
    type: boolean

Outputs

changed:
  description: Whether there was a change done.
  returned: always
  type: bool
senhasegura_device:
  description: Dictionary containing result properties.
  returned: always
  sample:
    result:
      description: device properties, based on senhasegura informations
      returned: success
      type: complex
  type: dict
status_code:
  description: Result HTTP Status code
  returned: always
  sample: 200
  type: int