theforeman.foreman.foreman_compute_profile (0.8.1) — module

Manage Foreman Compute Profiles using Foreman API

Authors: Philipp Joos (@philippj), Baptiste Agasse (@bagasse)

preview | supported by community

Install collection

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


Add to requirements.yml

  collections:
    - name: theforeman.foreman
      version: 0.8.1

Description

Create and delete Foreman Compute Profiles using Foreman API


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: compute profile
  foreman_compute_profile:
    name: example_compute_profile
    server_url: "https://foreman.example.com"
    username: admin
    password: secret
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: another compute profile
  foreman_compute_profile:
    name: another_example_compute_profile
    compute_attributes:
    - compute_resource: ovirt_compute_resource1
      vm_attrs:
        cluster: 'a96d44a4-f14a-1015-82c6-f80354acdf01'
        template: 'c88af4b7-a24a-453b-9ac2-bc647ca2ef99'
        instance_type: 'cb8927e7-a404-40fb-a6c1-06cbfc92e077'
    server_url: "https://foreman.example.com"
    username: admin
    password: secret
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: compute profile2
  foreman_compute_profile:
    name: example_compute_profile2
    compute_attributes:
    - compute_resource: ovirt_compute_resource01
      vm_attrs:
        cluster: a96d44a4-f14a-1015-82c6-f80354acdf01
        cores: 1
        sockets: 1
        memory: 1073741824
        ha: 0
        interfaces_attributes:
          0:
            name: ""
            network: 390666e1-dab3-4c99-9f96-006b2e2fd801
            interface: virtio
        volumes_attributes:
          0:
            size_gb: 16
            storage_domain: 19c50090-1ab4-4023-a63f-75ee1018ed5e
            preallocate: '1'
            wipe_after_delete: '0'
            interface: virtio_scsi
            bootable: 'true'
    - compute_resource: libvirt_compute_resource03
      vm_attrs:
        cpus: 1
        memory: 2147483648
        nics_attributes:
          0:
            type: bridge
            bridge: ""
            model: virtio
        volumes_attributes:
          0:
            pool_name: default
            capacity: 16G
            allocation: 16G
            format_type: raw
    server_url: "https://foreman.example.com"
    username: admin
    password: secret
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove compute profile
  foreman_compute_profile:
    name: example_compute_profile2
    server_url: "https://foreman.example.com"
    username: admin
    password: secret
    state: absent

Inputs

    
name:
    description: compute profile name
    required: true
    type: str

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

password:
    description: Password of the user accessing the Foreman server
    required: true
    type: str

username:
    description: Username accessing the Foreman server
    required: true
    type: str

server_url:
    description: URL of the Foreman server
    required: true
    type: str

updated_name:
    description: new compute profile name
    required: false
    type: str

validate_certs:
    aliases:
    - verify_ssl
    default: true
    description: Whether or not to verify the TLS certificates of the Foreman server
    type: bool

compute_attributes:
    description: Compute attributes related to this compute profile. Some of these attributes
      are specific to the underlying compute resource type
    elements: dict
    required: false
    suboptions:
      compute_resource:
        description:
        - Name of the compute resource the attribute should be for
        type: str
      vm_attrs:
        aliases:
        - vm_attributes
        description:
        - Hash containing the data of vm_attrs
        type: dict
    type: list