Generates a Combustion script file for openSUSE MicroOS/Elemental systems.
Combustion is a minimal provisioning framework that runs shell scripts on first boot. This resource generates the script file that can be uploaded to a volume and provided to the virtual machine.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as libvirt from "@pulumi/libvirt";
const microos = new libvirt.Combustion("microos", {
name: "microos-combustion",
content: `#!/bin/bash
# combustion: network
echo \\"root:password\\" | chpasswd
systemctl enable sshd
`,
});
const combustion = new libvirt.Volume("combustion", {
name: "microos-combustion.sh",
pool: "default",
format: "raw",
create: {
content: {
url: microos.path,
},
},
});
import pulumi
import pulumi_libvirt as libvirt
microos = libvirt.Combustion("microos",
name="microos-combustion",
content="""#!/bin/bash
# combustion: network
echo \"root:password\" | chpasswd
systemctl enable sshd
""")
combustion = libvirt.Volume("combustion",
name="microos-combustion.sh",
pool="default",
format="raw",
create={
"content": {
"url": microos.path,
},
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/libvirt/libvirt"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
microos, err := libvirt.NewCombustion(ctx, "microos", &libvirt.CombustionArgs{
Name: pulumi.String("microos-combustion"),
Content: pulumi.String("#!/bin/bash\n# combustion: network\necho \\\"root:password\\\" | chpasswd\nsystemctl enable sshd\n"),
})
if err != nil {
return err
}
_, err = libvirt.NewVolume(ctx, "combustion", &libvirt.VolumeArgs{
Name: pulumi.String("microos-combustion.sh"),
Pool: pulumi.String("default"),
Format: pulumi.String("raw"),
Create: &libvirt.VolumeCreateArgs{
Content: &libvirt.VolumeCreateContentArgs{
Url: microos.Path,
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Libvirt = Pulumi.Libvirt;
return await Deployment.RunAsync(() =>
{
var microos = new Libvirt.Combustion("microos", new()
{
Name = "microos-combustion",
Content = @"#!/bin/bash
# combustion: network
echo \""root:password\"" | chpasswd
systemctl enable sshd
",
});
var combustion = new Libvirt.Volume("combustion", new()
{
Name = "microos-combustion.sh",
Pool = "default",
Format = "raw",
Create = new Libvirt.Inputs.VolumeCreateArgs
{
Content = new Libvirt.Inputs.VolumeCreateContentArgs
{
Url = microos.Path,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.libvirt.Combustion;
import com.pulumi.libvirt.CombustionArgs;
import com.pulumi.libvirt.Volume;
import com.pulumi.libvirt.VolumeArgs;
import com.pulumi.libvirt.inputs.VolumeCreateArgs;
import com.pulumi.libvirt.inputs.VolumeCreateContentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var microos = new Combustion("microos", CombustionArgs.builder()
.name("microos-combustion")
.content("""
#!/bin/bash
# combustion: network
echo \"root:password\" | chpasswd
systemctl enable sshd
""")
.build());
var combustion = new Volume("combustion", VolumeArgs.builder()
.name("microos-combustion.sh")
.pool("default")
.format("raw")
.create(VolumeCreateArgs.builder()
.content(VolumeCreateContentArgs.builder()
.url(microos.path())
.build())
.build())
.build());
}
}
resources:
microos:
type: libvirt:Combustion
properties:
name: microos-combustion
content: |
#!/bin/bash
# combustion: network
echo \"root:password\" | chpasswd
systemctl enable sshd
combustion:
type: libvirt:Volume
properties:
name: microos-combustion.sh
pool: default
format: raw
create:
content:
url: ${microos.path}
See the Combustion documentation for script format details.
Create Combustion Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Combustion(name: string, args: CombustionArgs, opts?: CustomResourceOptions);@overload
def Combustion(resource_name: str,
args: CombustionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Combustion(resource_name: str,
opts: Optional[ResourceOptions] = None,
content: Optional[str] = None,
name: Optional[str] = None)func NewCombustion(ctx *Context, name string, args CombustionArgs, opts ...ResourceOption) (*Combustion, error)public Combustion(string name, CombustionArgs args, CustomResourceOptions? opts = null)
public Combustion(String name, CombustionArgs args)
public Combustion(String name, CombustionArgs args, CustomResourceOptions options)
type: libvirt:Combustion
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CombustionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CombustionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CombustionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CombustionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CombustionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var combustionResource = new Libvirt.Combustion("combustionResource", new()
{
Content = "string",
Name = "string",
});
example, err := libvirt.NewCombustion(ctx, "combustionResource", &libvirt.CombustionArgs{
Content: pulumi.String("string"),
Name: pulumi.String("string"),
})
var combustionResource = new Combustion("combustionResource", CombustionArgs.builder()
.content("string")
.name("string")
.build());
combustion_resource = libvirt.Combustion("combustionResource",
content="string",
name="string")
const combustionResource = new libvirt.Combustion("combustionResource", {
content: "string",
name: "string",
});
type: libvirt:Combustion
properties:
content: string
name: string
Combustion Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Combustion resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the Combustion resource produces the following output properties:
Look up Existing Combustion Resource
Get an existing Combustion resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CombustionState, opts?: CustomResourceOptions): Combustion@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
content: Optional[str] = None,
name: Optional[str] = None,
path: Optional[str] = None,
size: Optional[float] = None) -> Combustionfunc GetCombustion(ctx *Context, name string, id IDInput, state *CombustionState, opts ...ResourceOption) (*Combustion, error)public static Combustion Get(string name, Input<string> id, CombustionState? state, CustomResourceOptions? opts = null)public static Combustion get(String name, Output<String> id, CombustionState state, CustomResourceOptions options)resources: _: type: libvirt:Combustion get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
Package Details
- Repository
- libvirt dmacvicar/terraform-provider-libvirt
- License
- Notes
- This Pulumi package is based on the
libvirtTerraform Provider.
