Skip to content
Volker Hilsheimer edited this page Feb 1, 2022 · 4 revisions

A role is a collection of provisioning steps that are executed when the machine is booted up for the first time, or when provisioned explicitly using either

$ minicoin provision machine

or

$ minicoin up --provision machine

At the end of provisioning, the machine should be able to execute the tasks it is designed for. minicoin provides a library of common roles.

Which roles a machine should have after provisioning is defined using the roles attribute in the machine's definition:

- name: multiple
  box: generic/ubuntu2004
  roles:
    - base  # installs up basic packages
    - build # installs build tools and dependencies
    - test  # installs dependencies for tests to run

- name: parameterized
  box: generic/ubuntu2004
  roles:
    - role: arguments
      param1: foo
      param2: bar
    - docker: name
      image: foo/bar

Which parameters a role accepts depends on the role implementation.

To re-apply a provisioning step defined by a specific role that the machine uses, run

$ minicoin provision machine --provision-with role:type

e.g.

$ minicoin provision ubuntu1804 --provision-with linux-desktop:script