Host Group
add_host_to_hostgroup
Add hosts to host groups.
Host name and group arguments are interpreted as IDs if they are numeric.
Examples
Add a host to a host group
Add multiple hosts to a host group
Add multiple hosts to multiple host groups
Arguments
HOSTS
Host names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
HOSTGROUPS
Host group names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--dryrun
Preview changes
Type: boolean
Default: False
create_hostgroup
Create a new host group.
Assigns default user group permissions by default.
--rw-groups
defaults to config optionapp.default_admin_usergroups
.--ro-groups
defaults to config optionapp.default_create_user_usergroups
.- Use
--no-usergroup-permissions
to create a group without any user group permissions.
Examples
Create a host group with default user group permissions
Create a host group with specific RO and RW groups
Create a host group with no user group permissions
Arguments
HOSTGROUP
Name of host group.
Type: text
Required: ✅
Options
--rw-groups
<RW_GROUPS>
User group(s) to give read/write permissions. Comma-separated.
Type: text
--ro-groups
<RO_GROUPS>
User group(s) to give read-only permissions. Comma-separated.
Type: text
--no-usergroup-permissions
Do not assign user group permissions.
Type: boolean
Default: False
extend_hostgroup
Add all hosts from a host group to other host groups.
The source group is not modified. Existing hosts in the destination group(s) are not removed or modified.
Arguments
SRC_GROUP
Group to get hosts from.
Type: text
Required: ✅
DEST_GROUP
Group(s) to add hosts to. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--dryrun
Show hosts and groups without making changes.
Type: boolean
Default: False
move_hosts
Move all hosts from one host group to another.
Arguments
SRC_GROUP
Group to move hosts from.
Type: text
Required: ✅
DEST_GROUP
Group to move hosts to.
Type: text
Required: ✅
Options
--rollback
/--no-rollback
Rollback changes if hosts cannot be removed from source group afterwards.
Type: boolean
Default: True
--dryrun
Show hosts and groups without making changes.
Type: boolean
Default: False
remove_host_from_hostgroup
Remove hosts from host groups.
Examples
Remove a host to a host group
Remove multiple hosts from a host group
Remove multiple hosts from multiple host groups
Arguments
HOSTS
Host names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
HOSTGROUPS
Host group names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--dryrun
Preview changes
Type: boolean
Default: False
remove_hostgroup
Delete a host group.
Arguments
HOSTGROUP
Name of host group(s) to delete. Comma-separated.
Type: text
Required: ✅
Options
--force
Remove host group even if it contains hosts.
Type: boolean
Default: False
show_hostgroup
Show details of a host group.
Arguments
HOSTGROUP
Name of host group.
Type: text
Required: ✅
show_hostgroup_permissions
Show usergroups with permissions for the given hostgroup.
Shows permissions for all host groups by default.
Arguments
HOSTGROUPS
Host group name(s). Comma-separated. Supports wildcards.
Type: text
Required: ✅
show_hostgroups
Show details for host groups.
Limits results to 20 by default. Fetching all host groups with hosts can be extremely slow.
Examples
Show all host groups
Show all host groups starting with 'Web-'
Show host groups with 'web' in the name
Arguments
NAME
Name of host group(s). Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--hosts
/--no-hosts
Show hosts in each host group.
Type: boolean
Default: True
--limit
, -n
<LIMIT>
Limit the number of results. 0 to show all.
Type: integer
Default: 0