Getting started

Example inventory

To configure whereami on hosts you can put them into the ypid_service_whereami Ansible inventory group:

[ypid_service_whereami]
hostname

Example playbook

Here's an example playbook that uses the ypid.whereami role:

---

- name: Setup and configure whereami
  hosts: [ 'ypid_service_whereami' ]
  become: True

  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'

  roles:

    - role: ypid.whereami
      tags: [ 'role::whereami' ]

The playbooks is shipped with this role under docs/playbooks/whereami.yml from which you can symlink it to your playbook directory. In case you use multiple roles maintained by ypid, consider using the ypid-ansible-common.

Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after host is first configured to speed up playbook execution, when you are sure that most of the configuration has not been changed.

Available role tags:

role::whereami
Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.
role::whereami:pkgs
Tasks related to system package management like installing or removing packages.
role::whereami:install
Tasks related to the installation and patching of whereami.
role::whereami:config
Tasks related to the configuration of whereami.