Sha256: ed7bb546977bea8a2c555aec6d0c5516673f50f31c1a417c3da27040ae0e6454

Contents?: true

Size: 1.51 KB

Versions: 146

Compression:

Stored size: 1.51 KB

Contents

Each host in a host configuration file is defined to have one or more roles.  Beaker supports the roles `master`, `agent`, `frictionless`, `dashboard` and `database`.  These roles indicate what Puppet responsibilities the host will assume.  If puppet is installed as part of the Beaker test execution then the roles will be honored (ie, the host defined as `master` will become the puppet master node).  Other than puppet installation, the roles provide short cuts to node access.  In tests you can refer to nodes by role:

    on master, "echo hello"
    on database, "echo hello"

## Creating Your Own Roles
Arbitrary role creating is supported in Beaker.  New roles are created as they are discovered in the host/config file provided at runtime.

### Example User Role Creation
```
HOSTS:
  pe-ubuntu-lucid:
    roles:
      - agent
      - dashboard
      - database
      - master
      - nodes
      - ubuntu
    vmname : pe-ubuntu-lucid
    platform: ubuntu-10.04-i386
    snapshot : clean-w-keys
    hypervisor : fusion
  pe-centos6:
    roles:
      - agent
      - nodes
      - centos
    vmname : pe-centos6
    platform: el-6-i386
    hypervisor : fusion
    snapshot: clean-w-keys
CONFIG:
  nfs_server: none
  consoleport: 443
```

In this case I've created the new roles `nodes`, `centos` and `ubuntu`.  These roles can now be used to call any Beaker DSL methods that require a host.

```
on centos, 'echo I'm the centos box'
on ubuntu, 'echo I'm the ubuntu box'
on nodes, 'echo this command will be executed on both defined hosts'
```

Version data entries

146 entries across 146 versions & 1 rubygems

Version Path
beaker-6.4.1 docs/concepts/roles_what_are_they.md
beaker-6.4.0 docs/concepts/roles_what_are_they.md
beaker-6.3.0 docs/concepts/roles_what_are_they.md
beaker-6.2.0 docs/concepts/roles_what_are_they.md
beaker-6.1.0 docs/concepts/roles_what_are_they.md
beaker-5.8.1 docs/concepts/roles_what_are_they.md
beaker-4.42.0 docs/concepts/roles_what_are_they.md
beaker-5.8.0 docs/concepts/roles_what_are_they.md
beaker-5.7.0 docs/concepts/roles_what_are_they.md
beaker-4.41.2 docs/concepts/roles_what_are_they.md
beaker-4.41.1 docs/concepts/roles_what_are_they.md
beaker-5.6.0 docs/concepts/roles_what_are_they.md
beaker-4.41.0 docs/concepts/roles_what_are_they.md
beaker-5.5.0 docs/concepts/roles_what_are_they.md
beaker-5.4.0 docs/concepts/roles_what_are_they.md
beaker-5.3.1 docs/concepts/roles_what_are_they.md
beaker-4.40.2 docs/concepts/roles_what_are_they.md
beaker-5.3.0 docs/concepts/roles_what_are_they.md
beaker-4.40.1 docs/concepts/roles_what_are_they.md
beaker-5.2.0 docs/concepts/roles_what_are_they.md