summaryrefslogtreecommitdiff
path: root/Rakefile
blob: acb3c156c1c5667bf4f7aa108b542bd4963274d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require_relative 'lib/dsl'

desc 'Set up wireguard mesh'
task :wireguard do
  configure do
    # p option :verbose
    # dump_config
    only_when { hostname is :earth }

    file '/tmp/test/wg/wg0.conf' do
      create_parent_directory and from_template
      
      'the content is here and the result is <%= 1 + 2 %>'
    end

    file '/tmp/test/wg/wg1.conf' do
      create_parent_directory and from_sourcefile

      './Rakefile'
    end
  end
end

desc 'foo task'
task :foo do
  configure do
    file '/tmp/test.txt' do
      [ 'foo', 'bar', 'baz' ].sort
    end
  end
end