theforeman.foreman.compute_attribute – Manage Compute Attributes

Note

This plugin is part of the theforeman.foreman collection (version 1.5.0).

To install it use: ansible-galaxy collection install theforeman.foreman.

To use it in a playbook, specify: theforeman.foreman.compute_attribute.

New in version 1.0.0: of theforeman.foreman

Synopsis

  • Manage Compute Attributes

  • This beta version can create, and update compute attributes

Requirements

The below requirements are needed on the host that executes this module.

  • requests

Parameters

Parameter Choices/Defaults Comments
compute_profile
string / required
Name of compute profile
compute_resource
string / required
Name of compute resource
password
string / required
Password of the user accessing the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_PASSWORD will be used instead.
server_url
string / required
URL of the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_SERVER_URL will be used instead.
state
string
    Choices:
  • present ←
  • absent
State of the entity
username
string / required
Username accessing the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_USERNAME will be used instead.
validate_certs
boolean
    Choices:
  • no
  • yes ←
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 FOREMAN_VALIDATE_CERTS will be used instead.
vm_attrs
dictionary
Hash containing the data of vm_attrs

aliases: vm_attributes

Examples

- name: "Create compute attribute"
  theforeman.foreman.compute_attribute:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    compute_profile: "Test Compute Profile"
    compute_resource: "Test Compute Resource"
    vm_attrs:
      memory_mb: '2048'
      cpu: '2'
    state: present

- name: "Update compute attribute"
  theforeman.foreman.compute_attribute:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    compute_profile: "Test Compute Profile"
    compute_resource: "Test Compute Resource"
    vm_attrs:
      memory_mb: '1024'
      cpu: '1'
    state: present

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
entity
dictionary
success
Final state of the affected entities grouped by their type.

 
compute_attributes
list / elements=dictionary
success
List of compute attributes.

   
attributes
dictionary
success
Effective attributes for the given combination of compute profile and resource.

   
compute_profile_id
integer
success
Database id of the associated compute profile.

   
compute_profile_name
string
success
Name of the associated compute profile.

   
compute_resource_id
integer
success
Database id of the associated compute resource.

   
compute_resource_name
string
success
Name of the associated compute resource.

   
created_at
string
success
Creation date of the compute attribute.

   
id
integer
success
Database id of the compute_attribute.

   
name
string
success
Generated friendly name for the compute attribute.

   
provider_friendly_name
string
success
Name of the provider type of the compute resource.

   
updated_at
string
success
Date of last change to the compute attribute.

   
vm_attrs
dictionary
success
Configured attributes.



Authors

  • Manisha Singhal (@Manisha15) ATIX AG