-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from lsst-it/dracal-usb-pth450
Add support for Dracal USB PTH450
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This file is managed by Puppet; changes may be overwritten. | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="1781", ATTR{idProduct}=="0a98", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0500", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0501", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0502", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0503", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0504", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0505", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0506", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0507", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0508", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0509", GROUP="dialout", MODE="0664" | ||
SUBSYSTEM=="usb", ATTR{idVendor}=="289b", ATTR{idProduct}=="0510", GROUP="dialout", MODE="0664" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# @summary | ||
# Install Dracal USB pth450 support. | ||
# | ||
# @param tarfile | ||
# Name of tarfile to install. | ||
# | ||
class ccs_hcu::pth450 ( | ||
String $tarfile = 'dracalview-client-bin-3.2.2.tar.xz', | ||
) { | ||
$ptitle = regsubst($title, '::.*', '', 'G') | ||
|
||
$bindir = '/usr/local/bin' | ||
|
||
archive { "/var/tmp/${tarfile}": | ||
ensure => present, | ||
source => "${ccs_hcu::pkgurl}/${tarfile}", | ||
username => $ccs_hcu::pkgurl_user.unwrap, | ||
password => $ccs_hcu::pkgurl_pass.unwrap, | ||
extract => true, | ||
extract_path => $bindir, | ||
extract_command => 'tar --no-same-owner -axf %s', | ||
cleanup => false, | ||
user => 'root', | ||
group => 'root', | ||
## It creates some other files too. | ||
creates => "${bindir}/dracal-usb-get", | ||
} | ||
|
||
## Add udev rule to set permissions. | ||
$udev = '70-dracal.rules' | ||
|
||
file { "/etc/udev/rules.d/${udev}": | ||
ensure => 'file', | ||
source => "puppet:///modules/${ptitle}/${udev}", | ||
notify => Exec['udevadm pth450'], | ||
} | ||
|
||
exec { 'udevadm pth450': | ||
path => ['/usr/sbin', '/usr/bin'], | ||
# lint:ignore:strict_indent | ||
command => @("CMD"/L), | ||
sh -c 'udevadm control --reload-rules && \ | ||
udevadm trigger --type=devices --action=change' | ||
| CMD | ||
# lint:endignore | ||
refreshonly => true, | ||
} | ||
} |