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-groupsdefaults to config optionapp.commands.create_hostgroup.rw_groups.--ro-groupsdefaults to config optionapp.commands.create_hostgroup.ro_groups.- Use
--no-default-usergroupsto avoid adding user to default user groups.
Examples
Create a host group with default user group permissions from config
Create a host group with specific RO and RW user group access
Create a host group without default 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
--default-usergroups, --usergroup-permissions/--no-default-usergroups, --no-usergroup-permissions
Assign default user group permissions from configs.
Type: boolean
Default: True
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.
Fetching all host groups with hosts can be extremely slow. It is recommended to
use --no-hosts when not using a specific name filter.
Examples
Show all host groups (excluding hosts)
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
Default: *
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