GithubHelp home page GithubHelp logo

joshbeard / puppet-display Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 6.0 87 KB

Puppet module for managing Xvfb and x11vnc remote displays

License: Other

Ruby 50.70% Puppet 31.49% Shell 17.76% Pascal 0.05%

puppet-display's Introduction

puppet-display

NOTICE: This project is dormant and looking for a new owner. If you would like to assume the role of maintaining this project, please get in touch with [email protected]


Build Status

Table of Contents

  1. Overview
  2. Setup - The basics of getting started with display
  3. Usage - Configuration options and additional functionality
  4. Reference - classes and parameters
  5. Limitations - OS compatibility, etc.
  6. Contributors

Overview

The display module can manage Xvfb (X Virtual Framebuffer) and x11vnc for remote displays.

The base class, display, can be used to manage both xvfb and x11vnc together.

xvfb and x11vnc can be managed individually using their own classes if desired.

Additionally, a profile.d helper script can be managed that exports the DISPLAY environment variable.

Setup

What display affects

The display module can manage the following:

  • xvfb package
  • xvfb service
  • x11vnc package
  • x11vnc service

Usage

To manage xvfb and x11vnc with default parameters:

include ::display

Custom display, resolution and color depth:

class { 'display':
  display => 99,   # default is 0
  width   => 1024, # default is 1280
  height  => 768,  # default is 800
  color   => 24,   # default is "24+32" (i.e. 32-bit)
}

Running as a custom user (both xvfb and x11vnc):

class { 'display':
  runuser => 'xvfbservice',
}

Only manage xvfb (e.g. not x11vnc) and specify a custom user and fbdir:

class { 'display::xvfb':
  runuser => 'xvfbuser',
  fbdir   => '/var/tmp/xvfb',
}

Only manage x11vnc:

class { 'display::x11vnc':
  display => 3,
  runuser => 'x11user',
}

Reference

Classes

  • display: Main class, includes all other classes (wrapper)
  • display::xvfb: Manages xvfb
  • display::x11vnc: Manages x11vnc

Class: display

display

X display to use. Default is 0

width

Screen width to use. Default is 1280

height

Screen height to use. Default is 800

color

Screen color depth to use. Default is '24+32' (32-bit)

runuser

User to run xvfb as. Default is 'root'

fbdir

Directory in which the memory mapped files containing the framebuffer memory should be created. Defaults to '/tmp'

xvfb_package

Package name for installing xvfb. Defaults to xorg-x11-servers-Xvfb on RedHat systems and xvfb on Debian systems.

xvfb_service

Name of the xvfb service. This class will create an init script with this name and manage a service by this name. Defaults to xvfb

xvfb_bin

Absolute path to the xvfb executable. Defaults to /usr/bin/xvfb on RedHat and Debian systems and /usr/local/bin/Xvfb on FreeBSD.

xvfb_custom_args

Custom arguments to use for starting xvfb. If this parameter is defined, the display, width, height, color, and fbdir parameter values will not be used for starting the xvfb service via the init script - that's left up to the user. Optional. Defaults to undefined.

x11vnc_package

Package name for installing x11vnc. Defaults to x11vnc on RedHat and Debian systems.

x11vnc_service

Name of the x11vnc service. This class will create an init script with this name and manage a service with this name. Defaults to x11vnc

x11vnc_bin

Absolute path to the x11vnc executable. Defaults to /usr/bin/x11vnc on RedHat and Debian systems and /usr/local/bin/x11vnc on FreeBSD.

x11vnc_custom_args

Custom arguments to use for starting x11vnc. If this parameter is defined, the display parameter is unused for starting x11vnc - that's left up to the user. Optional. Defaults to undefined.

display_env

Boolean. Provide a profile.d script to export the DISPLAY variable. Defaults to true.

NOTE: This parameter and the display::env class is being deprecated and will soon be removed.

display_env_path

Absolute path to place a profile.d script that exports the DISPLAY variable. Defaults to /etc/profile.d/vagrant_display.sh This is only effective if 'profiled' is true.

NOTE: This parameter and the display::env class is being deprecated and will soon be removed.

Class: display::xvfb

display

X display to use. Default is 0

width

Screen width to use. Default is 1280

height

Screen height to use. Default is 800

color

Screen color depth to use. Default is '24+32' (32-bit)

runuser

User to run xvfb as. Default is 'root'

fbdir

Directory in which the memory mapped files containing the framebuffer memory should be created. Defaults to '/tmp'

package

Package name for installing xvfb. Defaults to xorg-x11-servers-Xvfb on RedHat systems and xvfb on Debian systems.

custom_args

Custom arguments to use for starting xvfb. If this parameter is defined, the display, width, height, color, and fbdir parameter values will not be used for starting the xvfb service via the init script - that's left up to the user. Optional. Defaults to undefined.

service

Name of the xvfb service. This class will create an init script with this name and manage a service by this name. Defaults to xvfb

Class: display::x11vnc

display

X display to use. Default is 0

runuser

User to run xvfb as. Default is 'root'

package

Package name for installing x11vnc. Defaults to x11vnc on RedHat and Debian systems.

service

Name of the x11vnc service. This class will create an init script with this name and manage a service with this name. Defaults to x11vnc

x11vnc_bin

Absolute path to the x11vnc executable. Defaults to /usr/bin/x11vnc on RedHat and Debian systems and /usr/local/bin/x11vnc on FreeBSD.

custom_args

Custom arguments to use for starting x11vnc. If this parameter is defined, the display parameter is unused for starting x11vnc - that's left up to the user. Optional. Defaults to undefined.

Class: display::env

NOTE: This class is being deprecated and will soon be removed.

This is better managed by your own implementation class. For example, a profile class.

file

Absolute path where a file should be place that exports the DISPLAY environment variable. Defaults to /etc/profile.d/vagrant_display.sh

display

X display to use. Default is 0

Limitations

This module has been built on a tested against Puppet 3.

Supported and tested on RedHat, Debian, and FreeBSD families.

Contributors

Alex Rodionov https://github.com/p0deje

Josh Beard http://joshbeard.me

Joshua Hoblitt https://github.com/jhoblitt

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

puppet-display's People

Contributors

joshbeard avatar krzysztofhajdamowicz avatar masseyc avatar p0deje avatar tayzlor avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-display's Issues

Update module on puppet forge

Hello,
It's been 2 years since last commit and update on Puppet Forge.
Also, there are commits since last release. Is it possible to update module on Puppet Forge?

Also, Can you consider donating your module to Vox Populi?
https://voxpupuli.org

validate_re for validating numbers?

noticing that your using validate_re for checking if certain values are numeric, however (atleast with puppet 4) this actually fails if you supply a number rather than a string containing a number. Given that puppet will do automatic conversion of strings to numbers why not do something like,

validate_integer($width + 0)?

Question about adding xclock capability

We use this module for starting a vnc server so that we can video record test runs. During those runs it is helpful to have an xclock instance in the lower corner. Is that something you view in scope for a plugin like this? If so we could contribute the capability. If not, feel free to resolve the issue.

Thanks,

Scott

Cannot install module on ubuntu 16.04 LTS. with concat version 2.1.0

puppet module install joshbeard-display
Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Error: Could not install module 'joshbeard-display' (???)
No version of 'joshbeard-display' can satisfy all dependencies
Use puppet module install --ignore-dependencies to install only this module

puppetlabs/concat (>= 1.0.0 <2.0.0)

I assume this is because module does not support newer versions of concat then 2.0.0? and current version is 2.1.0

With the -loop option x11vnc runs multiple processes

Hi there,

with the -loop option x11vnc runs multiple processes and stopping with the initscript does not kill all of them, resulting in a stuck process.

So I replaced:
start-stop-daemon --stop --quiet --chuid <%= @runuser %> --pidfile $PIDFILE
With
pkill -f $BINARY -u <%= @runuser %>

Also note that systemctl daemon-reload must be run.

systemd-based startup of xvfb/x11vnc fails

I am using your module in a Vagrant environment, but I get the following failures:

==> web: Error: Could not start Service[xvfb]: Execution of '/bin/systemctl start xvfb' returned 6: Failed to start xvfb.service: Unit xvfb.service failed to load: No such file or directory.
==> web: Wrapped exception:
==> web: Execution of '/bin/systemctl start xvfb' returned 6: Failed to start xvfb.service: Unit xvfb.service failed to load: No such file or directory.
==> web: Error: /Stage[main]/Display::Xvfb/Service[xvfb]/ensure: change from stopped to running failed: Could not start Service[xvfb]: Execution of '/bin/systemctl start xvfb' returned 6: Failed to start xvfb.service: Unit xvfb.service failed to load: No such file or directory.
==> web: Notice: /Stage[main]/Display::Xvfb/Service[xvfb]: Triggered 'refresh' from 1 events
==> web: Notice: /Stage[main]/Display::X11vnc/Package[x11vnc]: Dependency Service[xvfb] has failures: true
==> web: Warning: /Stage[main]/Display::X11vnc/Package[x11vnc]: Skipping because of failed dependencies
==> web: Notice: /Stage[main]/Display::X11vnc/File[x11vnc-init]: Dependency Service[xvfb] has failures: true
==> web: Warning: /Stage[main]/Display::X11vnc/File[x11vnc-init]: Skipping because of failed dependencies
==> web: Notice: /Stage[main]/Display::X11vnc/Service[x11vnc]: Dependency Service[xvfb] has failures: true
==> web: Warning: /Stage[main]/Display::X11vnc/Service[x11vnc]: Skipping because of failed dependencies

It seems to me that the system is attempting to ensure the services are running via systemd, but the module is not providing systemd-based init scripts.

Thanks,

Scott

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.