Getting started

Default configuration

The sysfs configuration will not be applied by default in a container environment (LXC, OpenVZ), since these environments usually have the /sys filesystem mounted read-only. You can control this using the sysfs__enabled variable.

Example inventory

To configure the /sys kernel filesystem on a host by the debops.sysfs role, that host needs to be added to the [debops_service_sysfs] Ansible inventory group:

[debops_service_sysfs]
hostname

Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.sysfs role:

---

- name: Configure sysfs options
  collections: [ 'debops.debops' ]
  hosts: [ 'debops_service_sysfs' ]
  become: True

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

  pre_tasks:

    - import_role:
        name: 'sysfs'
        tasks_from: 'main_env'
      tags: [ 'role::sysfs', 'role::secret' ]

  roles:

    - role: secret
      tags: [ 'role::secret', 'role::sysfs' ]
      secret__directories:
        - '{{ sysfs__secret__directories | d([]) }}'

    - role: sysfs
      tags: [ 'role::sysfs', 'skip::sysfs' ]