Getting started¶
Example inventory¶
Add the hosts on which Opsi should be manage to the
ypid_service_opsi
Ansible inventory host group:
[ypid_service_opsi]
hostname
Example playbook¶
Here's an example playbook that uses the ypid.opsi
role:
---
- name: 'Manage Opsi using Ansible :)'
hosts: [ 'ypid_service_opsi' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: ypid.opsi
tags: [ 'role::opsi' ]
This playbook is shipped with this role under docs/playbooks/opsi.yml
from which you can symlink it to your playbook directory.
In case you use multiple roles maintained by ypid, consider
using 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 a host was first
configured to speed up playbook execution, when you are sure that most of the
configuration is already in the desired state.
Available role tags:
role::opsi
- Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.
role::opsi:pkgs
- Tasks related to system package management like installing, upgrading or removing packages.
role::opsi:prod_update
- Tasks related to OPSI product updating.
role::opsi:installfiles
- Tasks related to OPSI product installation files.