ansible_vorteil.cloud.vorteil_create_injection_config (0.1.6) — module

Create the actual configuration TOML for injection URI for disk build

| "added in version" 2.10.0 of ansible_vorteil.cloud"

Authors: Wilhelm Wonigkeit (@bigwonig), Jon Alfaro (@jalfvort)

preview | supported by community

Install collection

Install with ansible-galaxy collection install ansible_vorteil.cloud:==0.1.6


Add to requirements.yml

  collections:
    - name: ansible_vorteil.cloud
      version: 0.1.6

Description

Inject a configuration into the URI to be used for disk building process.

The configuration can be passed as a JSON object, it will be converted to the appropriate TOML configurations.

For a sample JSON/TOML configuration, use the get_sample_vcfg call which will pass back a example vcfg [Vorteil Configuration].

This is step 2 out of 3 in the disk build process with injection


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: insert the configuration into the injection URI
  ansible_vorteil.cloud.vorteil_create_injection_config:
    repo_key: "{{ var_repo_key }}"
    repo_address: "{{ var_repo_address }}"
    repo_port: "{{ var_repo_port }}"
    repo_proto: "{{ var_repo_proto }}"
    use_default_kernel: False
    injection_json: {
                            'program' : [
                                {
                                    'args' : "-XzaArgs",
                                    'binary' : "/usr/bin/java",
                                    'env' : ["HOME=/export/home/java", "JAVA_HOME=/usr/lib/jre/"]
                                },
                                {
                                    'args' : "-QyRArgs",
                                    'binary' : "/acme",
                                    'env' : ["HOME=/export/home/acme", "ACME_HOME=/usr/bin/"]
                                }
                            ],
                            'info' : {
                                'author' : "Ansible Test Script",
                                'url' : "www.vorteil.io",
                                'version' : "1.0.1"
                            },
                            'vm' : {
                                'cpus' : 1,
                                'disk-size' : "512 MiB",
                                'ram' : "128 MiB"
                            },
                            'network' : [
                                {
                                    'gateway' : "192.168.1.1",
                                    'ip' : "192.168.1.10",
                                    'mask' : "255.255.255.0",
                                },
                                {
                                    'gateway' : "10.1.1.1",
                                    'ip' : "10.1.1.10",
                                    'mask' : "255.255.255.0",
                                }
                            ],
                            'route' : [
                                {
                                    'destination' : "192.0.0.0/8",
                                    'gateway' : "192.168.1.1",
                                    'interface' : "eth0"
                                },
                                {
                                    'destination' : "10.0.0.0/8",
                                    'gateway' : "10.1.1.1",
                                    'interface' : "eth1"
                                }
                            ]
                        }
    injection_uuiduri: "{{ geturicreateresponse }}"

Inputs

    
repo_key:
    description:
    - The access key for the Vorteil.io repo (user specific and generated during user
      configuration).
    - Only required if the repo has been configured for authenticated connections.
    required: false
    type: str

repo_port:
    description:
    - Admin port on which the repository is configured to listen (default 7472)
    required: false
    type: str

repo_proto:
    choices:
    - http
    - https
    default: http
    description:
    - Protocol to use (either http[default] or https)
    required: false
    type: str

repo_address:
    description:
    - FQDN for the Vorteil.io Repository to query
    - This can be set to "localhost" to connect you a systems local vorteil daemon process.
    required: true
    type: str

injection_json:
    description:
    - Configuration to inject into the URI - can be passed as JSON
    required: true
    type: dict

injection_uuiduri:
    description:
    - Dict object created using the vorteil_create_injection_uri call
    - uuid & uri are used to inject configurations into a queued disk build process
    required: true
    type: dict

use_default_kernel:
    default: true
    description:
    - Boolean value, uses the repo configured default kernel (default=True)
    required: false
    type: bool

Outputs

results:
  description:
  - A status message which indicates whether or not the configuration injection was
    successfull
  returned: success
  sample: Success
  type: str