Skip to content

Commit

Permalink
Prefer using require to before.
Browse files Browse the repository at this point in the history
When two resources are both installed unconditionally. I arbitrarily
prefer declaring the dependency with `require` rather than `before`.

Using `before` is still needed in cases where a dependency needs to be
declared on a resource that is only installed conditionally. An example
is the linux-aws kernel needing to be available before nvidia-375 when
on an EC2 instance.
  • Loading branch information
nuclearsandwich committed Apr 3, 2019
1 parent 03d45d9 commit d17584c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/profile/manifests/jenkins/agent_gpu.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# neeed for xhost
package { 'x11-xserver-utils' :
ensure => installed,
before => File['/etc/X11/xorg.conf']
}

if $facts['ec2_instance_id'] {
Expand All @@ -37,13 +36,17 @@
# compiling the nvidia driver
package { 'nvidia-375':
ensure => installed,
before => File['/etc/X11/xorg.conf'],
}

file { '/etc/X11/xorg.conf':
source => 'puppet:///modules/profile/jenkins/agent_gpu/etc/X11/xorg.conf',
mode => '0744',
require => Package[xserver-xorg-dev],
require => [
Package[lightdm],
Package['nvidia-375'],
Package['x11-xserver-utils'],
Package[xserver-xorg-dev],
],
}

apt::key { 'nvidia_docker_key' :
Expand All @@ -64,7 +67,6 @@

package { 'lightdm':
ensure => installed,
before => File['/etc/X11/xorg.conf']
}

file { '/etc/lightdm/xhost.sh':
Expand Down

0 comments on commit d17584c

Please sign in to comment.