docker-ansible
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/andrewrothstein/docker-ansible@a7e4b001f71a5fe1f9dbdae490120dbb33e0eeb2Entrypoint
Return Type
DockerAnsible ! Example
dagger -m github.com/andrewrothstein/docker-ansible@a7e4b001f71a5fe1f9dbdae490120dbb33e0eeb2 call \
func (m *MyModule) Example() *dagger.DockerAnsible {
return dag.
DockerAnsible()
}@function
def example() -> dagger.DockerAnsible:
return (
dag.docker_ansible()
)@func()
example(): DockerAnsible {
return dag
.dockerAnsible()
}Types
DockerAnsible 🔗
build() 🔗
Build docker-ansible images for specified OS and platforms
Return Type
[Container ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| os | String ! | - | No description provided |
| osVer | String ! | - | No description provided |
| upstreamOrg | String | null | No description provided |
| upstreamOs | String | null | No description provided |
| upstreamOsVer | String | null | No description provided |
| uvVersion | String ! | "latest" | No description provided |
| platforms | String ! | "linux/amd64" | No description provided |
Example
dagger -m github.com/andrewrothstein/docker-ansible@a7e4b001f71a5fe1f9dbdae490120dbb33e0eeb2 call \
build --os string --os-ver string --uv-version string --platforms stringfunc (m *MyModule) Example(os string, osVer string, uvVersion string, platforms string) []*dagger.Container {
return dag.
DockerAnsible().
Build(os, osVer, uvVersion, platforms)
}@function
def example(os: str, os_ver: str, uv_version: str, platforms: str) -> List[dagger.Container]:
return (
dag.docker_ansible()
.build(os, os_ver, uv_version, platforms)
)@func()
example(os: string, osVer: string, uvVersion: string, platforms: string): Container[] {
return dag
.dockerAnsible()
.build(os, osVer, uvVersion, platforms)
}genRoleFiles() 🔗
Generate GitHub Actions workflow and config files for an Ansible role
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| roleName | String ! | - | No description provided |
| roleDir | Directory | null | No description provided |
| workflowRef | String ! | "develop" | No description provided |
Example
dagger -m github.com/andrewrothstein/docker-ansible@a7e4b001f71a5fe1f9dbdae490120dbb33e0eeb2 call \
gen-role-files --role-name string --workflow-ref stringfunc (m *MyModule) Example(roleName string, workflowRef string) *dagger.Directory {
return dag.
DockerAnsible().
GenRoleFiles(roleName, workflowRef)
}@function
def example(role_name: str, workflow_ref: str) -> dagger.Directory:
return (
dag.docker_ansible()
.gen_role_files(role_name, workflow_ref)
)@func()
example(roleName: string, workflowRef: string): Directory {
return dag
.dockerAnsible()
.genRoleFiles(roleName, workflowRef)
}publish() 🔗
Build and publish docker-ansible images to Docker Hub and GHCR
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| os | String ! | - | No description provided |
| osVer | String ! | - | No description provided |
| dockerhubUsername | String | null | No description provided |
| dockerhubPassword | Secret | null | No description provided |
| ghcrUsername | String | null | No description provided |
| ghcrPassword | Secret | null | No description provided |
| upstreamOrg | String | null | No description provided |
| upstreamOs | String | null | No description provided |
| upstreamOsVer | String | null | No description provided |
| targetImageSemver | String ! | "0.0.0" | No description provided |
| uvVersion | String ! | "latest" | No description provided |
| dockerhubRegistry | String ! | "docker.io" | No description provided |
| dockerhubOrg | String ! | "andrewrothstein" | No description provided |
| dockerhubRepo | String ! | "docker-ansible" | No description provided |
| ghcrRegistry | String ! | "ghcr.io" | No description provided |
| ghcrOrg | String ! | "andrewrothstein" | No description provided |
| ghcrRepo | String ! | "docker-ansible" | No description provided |
| platforms | String ! | "linux/amd64" | No description provided |
Example
dagger -m github.com/andrewrothstein/docker-ansible@a7e4b001f71a5fe1f9dbdae490120dbb33e0eeb2 call \
publish --os string --os-ver string --target-image-semver string --uv-version string --dockerhub-registry string --dockerhub-org string --dockerhub-repo string --ghcr-registry string --ghcr-org string --ghcr-repo string --platforms stringfunc (m *MyModule) Example(ctx context.Context, os string, osVer string, targetImageSemver string, uvVersion string, dockerhubRegistry string, dockerhubOrg string, dockerhubRepo string, ghcrRegistry string, ghcrOrg string, ghcrRepo string, platforms string) []string {
return dag.
DockerAnsible().
Publish(ctx, os, osVer, targetImageSemver, uvVersion, dockerhubRegistry, dockerhubOrg, dockerhubRepo, ghcrRegistry, ghcrOrg, ghcrRepo, platforms)
}@function
async def example(os: str, os_ver: str, target_image_semver: str, uv_version: str, dockerhub_registry: str, dockerhub_org: str, dockerhub_repo: str, ghcr_registry: str, ghcr_org: str, ghcr_repo: str, platforms: str) -> List[str]:
return await (
dag.docker_ansible()
.publish(os, os_ver, target_image_semver, uv_version, dockerhub_registry, dockerhub_org, dockerhub_repo, ghcr_registry, ghcr_org, ghcr_repo, platforms)
)@func()
async example(os: string, osVer: string, targetImageSemver: string, uvVersion: string, dockerhubRegistry: string, dockerhubOrg: string, dockerhubRepo: string, ghcrRegistry: string, ghcrOrg: string, ghcrRepo: string, platforms: string): Promise<string[]> {
return dag
.dockerAnsible()
.publish(os, osVer, targetImageSemver, uvVersion, dockerhubRegistry, dockerhubOrg, dockerhubRepo, ghcrRegistry, ghcrOrg, ghcrRepo, platforms)
}testRole() 🔗
Test an Ansible role and optionally publish to a registry
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| os | String ! | - | No description provided |
| osVer | String ! | - | No description provided |
| roleName | String ! | "test-role" | No description provided |
| roleDir | Directory | null | No description provided |
| upstreamRegistry | String ! | "ghcr.io" | No description provided |
| upstreamOrg | String ! | "andrewrothstein" | No description provided |
| upstreamRepo | String ! | "docker-ansible" | No description provided |
| upstreamSemver | String ! | "0.0.0" | No description provided |
| targetRegistry | String | null | No description provided |
| targetOrg | String | null | No description provided |
| targetUsername | String | null | No description provided |
| targetPassword | Secret | null | No description provided |
| targetSemver | String ! | "0.0.0" | No description provided |
| platforms | String ! | "linux/amd64" | No description provided |
| gitSha | String | null | No description provided |
| publishLatest | Boolean ! | false | No description provided |
Example
dagger -m github.com/andrewrothstein/docker-ansible@a7e4b001f71a5fe1f9dbdae490120dbb33e0eeb2 call \
test-role --os string --os-ver string --role-name string --upstream-registry string --upstream-org string --upstream-repo string --upstream-semver string --target-semver string --platforms string --publish-latest booleanfunc (m *MyModule) Example(ctx context.Context, os string, osVer string, roleName string, upstreamRegistry string, upstreamOrg string, upstreamRepo string, upstreamSemver string, targetSemver string, platforms string, publishLatest bool) []string {
return dag.
DockerAnsible().
TestRole(ctx, os, osVer, roleName, upstreamRegistry, upstreamOrg, upstreamRepo, upstreamSemver, targetSemver, platforms, publishLatest)
}@function
async def example(os: str, os_ver: str, role_name: str, upstream_registry: str, upstream_org: str, upstream_repo: str, upstream_semver: str, target_semver: str, platforms: str, publish_latest: bool) -> List[str]:
return await (
dag.docker_ansible()
.test_role(os, os_ver, role_name, upstream_registry, upstream_org, upstream_repo, upstream_semver, target_semver, platforms, publish_latest)
)@func()
async example(os: string, osVer: string, roleName: string, upstreamRegistry: string, upstreamOrg: string, upstreamRepo: string, upstreamSemver: string, targetSemver: string, platforms: string, publishLatest: boolean): Promise<string[]> {
return dag
.dockerAnsible()
.testRole(os, osVer, roleName, upstreamRegistry, upstreamOrg, upstreamRepo, upstreamSemver, targetSemver, platforms, publishLatest)
}