Skip to content

Commit

Permalink
include documentation for the ansible galaxy role install feature
Browse files Browse the repository at this point in the history
  • Loading branch information
apenella committed Apr 3, 2024
1 parent 40388c0 commit 2eb3380
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ _**Important:** The master branch may contain unreleased or pre-released feature
- [Stdout Callback Execute structs](#stdout-callback-execute-structs)
- [Workflow package](#workflow-package)
- [WorkflowExecute struct](#workflowexecute-struct)
- [Galaxy package](#galaxy-package)
- [Galaxy Role Install package](#galaxy-role-install-package)
- [AnsibleGalaxyRoleInstallCmd struct](#ansiblegalaxyroleinstallcmd-struct)
- [AnsibleGalaxyRoleInstallOptions struct](#ansiblegalaxyroleinstalloptions-struct)
- [Inventory package](#inventory-package)
- [AnsibleInventoryCmd struct](#ansibleinventorycmd-struct)
- [AnsibleInventoryExecute struct](#ansibleinventoryexecute-struct)
Expand Down Expand Up @@ -711,6 +715,30 @@ if err != nil {
}
```
### Galaxy package
The `go-ansible` library provides you with the ability to interact with the _Ansible Galaxy_ command-line tool. To do that it includes the following package:
- `github.com/apenella/go-ansible/v2/pkg/galaxy/role/install`: Provides the functionality to install roles from the _Ansible Galaxy_.
#### Galaxy Role Install package
The `github.com/apenella/go-ansible/v2/pkg/galaxy/role/install` package allows you to install roles from the _Ansible Galaxy_ using the `ansible-galaxy` command. The package provides the following structs and functions:
##### AnsibleGalaxyRoleInstallCmd struct
The `AnsibleGalaxyRoleInstallCmd` struct enables the generation of `ansible-galaxy` commands to install roles. It implements the [Commander](#commander-interface) interface, so its method `Command` returns an array of strings that represents the command to be executed. An executor can use it to create the command to be executed.
The package provides the `NewAnsibleGalaxyRoleInstallCmd` function to create a new instance of the `AnsibleGalaxyRoleInstallCmd` struct. The function accepts a list of options to customize the `ansible-galaxy` command. The following functions are available:
- `WithBinary(binary string) AnsibleGalaxyRoleInstallOptionsFunc`: Set the binary for the `ansible-galaxy` command.
- `WithGalaxyRoleInstallOptions(options *AnsibleGalaxyRoleInstallOptions) AnsibleGalaxyRoleInstallOptionsFunc`: Set the role install options for the command.
- `WithRoleNames(roleNames ...string) AnsibleGalaxyRoleInstallOptionsFunc`: Set the role names for the `ansible-galaxy` command.
##### AnsibleGalaxyRoleInstallOptions struct
The `AnsibleGalaxyRoleInstallOptions` struct includes parameters described in the `Options` section of the _Ansible Galaxy_ manual page. It defines the behavior of the _Ansible Galaxy_ role installation operations and specifies where to find the configuration settings.
### Inventory package
The information provided in this section gives an overview of the `Inventory` package in `go-ansible`.
Expand Down

0 comments on commit 2eb3380

Please sign in to comment.