---
name: "Rex::Group::Lookup::YAML"
section: "3pm"
platform: "linux"
package: "rex"
version: "1.16.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Rex::Group::Lookup::YAML"
---

# Rex::Group::Lookup::YAML(3pm)

read hostnames and groups from a YAML file

## NAME

Rex::Group::Lookup::YAML - read hostnames and groups from a YAML file

## DESCRIPTION

With this module you can define hostgroups out of an yaml file.

## SYNOPSIS

```
 use Rex::Group::Lookup::YAML;
 groups_yaml "file.yml";
```

## EXPORTED FUNCTIONS

### groups\_yaml($file, create\_all\_group =\> $boolean )

With this function you can read groups from yaml files. The optional `"create_all_group"` option can be passed. If it is set to `"true"`, the group *all*, including all hosts, will also be created.

```
  # in my_groups.yml
  webserver:
   - fe01
   - fe02
   - f03
  backends:
   - be01
   - be02
   - f03
  # in Rexfile
  groups_yaml('my_groups.yml');
  # or
  groups_yaml('my_groups.yml', create_all_group => TRUE);
```
