Skip to content

Commit

Permalink
Update init.pp
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderMalmstrom committed Nov 20, 2024
1 parent ab8d2c3 commit 85c93a6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions modules/wireguard/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
class wireguard($current_event, $tunnelip) {
#Pull down clients

#Pull down FW rules from SVN
file { '/etc/iptables/rules.v4':
ensure => file,
recurse => remote,
source => "puppet:///svn/${current_event}/services/rules.v4",
}

exec { 'fw-rules': # exec resource named 'apt-update'
command => '/usr/sbin/iptables-restore /etc/iptables/rules.v4', # command this resource will run
#Apply FW rules
exec { 'fw-rules':
command => '/usr/sbin/iptables-restore /etc/iptables/rules.v4',
require => File['/etc/iptables/rules.v4'],
}

# Execute 'apt-get update'
exec { 'apt-update': # exec resource named 'apt-update'
command => '/usr/bin/apt-get update', # command this resource will run
exec { 'apt-update':
command => '/usr/bin/apt-get update',
}

# Install wireguard package
package { 'wireguard':
ensure => installed,
require => Exec['apt-update'], # require 'apt-update' before installing
require => Exec['apt-update'],
}

#Create wireguard dir
file{ '/etc/wireguard':
ensure => directory,
mode => '0600',
Expand Down

0 comments on commit 85c93a6

Please sign in to comment.