theforeman.foreman.role (4.0.0) — module

Manage Roles

| "added in version" 1.0.0 of theforeman.foreman"

Authors: Christoffer Reijer (@ephracis) Basalt AB

Install collection

Install with ansible-galaxy collection install theforeman.foreman:==4.0.0


Add to requirements.yml

  collections:
    - name: theforeman.foreman
      version: 4.0.0

Description

Create, update, and delete Roles


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: role
  theforeman.foreman.role:
    name: "Provisioner"
    description: "Only provision on libvirt"
    locations:
      - "Uppsala"
    organizations:
      - "ACME"
    filters:
      - permissions:
          - view_hosts
        search: "owner_type = Usergroup and owner_id = 4"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: present

Inputs

    
name:
    description: The name of the role
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the entity
    type: str

filters:
    description: Filters with permissions for this role
    elements: dict
    required: false
    suboptions:
      permissions:
        description: List of permissions
        elements: str
        required: true
        type: list
      search:
        description: Filter condition for the resources
        required: false
        type: str
    type: list

password:
    description:
    - Password of the user accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD)
      will be used instead.
    required: true
    type: str

username:
    description:
    - Username accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME)
      will be used instead.
    required: true
    type: str

locations:
    description: List of locations the entity should be assigned to
    elements: str
    type: list

server_url:
    description:
    - URL of the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL)
      will be used instead.
    required: true
    type: str

description:
    description: Description of the role
    required: false
    type: str

organizations:
    description: List of organizations the entity should be assigned to
    elements: str
    type: list

validate_certs:
    default: true
    description:
    - Whether or not to verify the TLS certificates of the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_VALIDATE_CERTS)
      will be used instead.
    type: bool

Outputs

entity:
  contains:
    roles:
      description: List of roles.
      elements: dict
      type: list
  description: Final state of the affected entities grouped by their type.
  returned: success
  type: dict