trombik.dbus

ansible-role-dbus

Install and set up dbus

Requirements

None

Role Variables

Variable Description Default
dbus_user User for dbus {{ __dbus_user }}
dbus_group Group for dbus {{ __dbus_group }}
dbus_package Name of the dbus package {{ __dbus_package }}
dbus_service Name of the dbus service {{ __dbus_service }}
dbus_conf_dir Config directory path {{ __dbus_conf_dir }}
dbus_systemd_dir Path to system.d directory {{ dbus_conf_dir }}/system.d
dbus_conf_file Path to system-local.conf {{ dbus_conf_dir }}/system-local.conf
dbus_system_local_config Content for system-local.conf See below
dbus_systemd_config List of files in the system.d directory. See below []

dbus_system_local_config

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig></busconfig>

dbus_systemd_config

This variable represents files that should be in dbus_systemd_dir.

Key Value Mandatory?
name Name of the file yes
state Must be either present or absent yes
content Content of the file no

Debian

Variable Default
__dbus_user messagebus
__dbus_group messagebus
__dbus_package dbus
__dbus_conf_dir /etc/dbus-1
__dbus_service dbus.service

FreeBSD

Variable Default
__dbus_user messagebus
__dbus_group messagebus
__dbus_package devel/dbus
__dbus_conf_dir /usr/local/etc/dbus-1
__dbus_service dbus

OpenBSD

Variable Default
__dbus_user _dbus
__dbus_group _dbus
__dbus_package dbus
__dbus_conf_dir /etc/dbus-1
__dbus_service messagebus

RedHat

Variable Default
__dbus_user messagebus
__dbus_group messagebus
__dbus_package dbus
__dbus_conf_dir /etc/dbus-1
__dbus_service dbus.service

Dependencies

None

Example Playbook

- hosts: localhost
  roles:
    - ansible-role-dbus
  pre_tasks:
    - name: Create _avahi user
      user:
        name: _avahi
        state: present
      when:
        - ansible_os_family != 'FreeBSD'
        - ansible_os_family != 'OpenBSD'
    - name: Create wheel group
      group:
        name: wheel
        state: present
      when:
        - ansible_os_family != 'FreeBSD'
        - ansible_os_family != 'OpenBSD'

  vars:
    dbus_systemd_config:
      - name: foo.conf
        state: absent
      - name: avahi-dbus.conf
        state: present
        content: |
          <!DOCTYPE busconfig PUBLIC
                    "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
                    "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
          <busconfig>

            <!-- Only root or user _avahi can own the Avahi service -->
            <policy user="_avahi">
              <allow own="org.freedesktop.Avahi"/>
            </policy>
            <policy user="root">
              <allow own="org.freedesktop.Avahi"/>
            </policy>

            <!-- Allow everyone to invoke methods on the Avahi server, except SetHostName -->
            <policy context="default">
              <allow send_destination="org.freedesktop.Avahi"/>
              <allow receive_sender="org.freedesktop.Avahi"/>

              <deny send_destination="org.freedesktop.Avahi"
                    send_interface="org.freedesktop.Avahi.Server" send_member="SetHostName"/>
            </policy>

            <!-- Users of the group "wheel" can access SetHostName -->
            <policy group="wheel">
              <allow send_destination="org.freedesktop.Avahi"/>
              <allow receive_sender="org.freedesktop.Avahi"/>
            </policy>
            <policy user="root">
              <allow send_destination="org.freedesktop.Avahi"/>
              <allow receive_sender="org.freedesktop.Avahi"/>
            </policy>
          </busconfig>

License

Copyright (c) 2017 Tomoyuki Sakurai <tomoyukis@reallyenglish.com>

You can use, copy, modify, and share this software for any reason, with or without payment, as long as you include the copyright notice and this permission notice in all copies.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES. THE AUTHOR IS NOT LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE.

Author Information

Tomoyuki Sakurai tomoyukis@reallyenglish.com

This README was made by qansible

Informazioni sul progetto

Install and configure dbus

Installa
ansible-galaxy install trombik.dbus
Licenza
isc
Download
72
Proprietario
PGP finger print: 03EB 3D97 5E04 9B0C AB21 93A2 D693 42A9 EFBC 3577 Makerspace and Coliving in Siem Reap, Cambodia: http://info.mkrsgh.org/