summaryrefslogtreecommitdiff
path: root/playground/Rakefile
blob: 63961eda886d618e2b77fc26e6752c96ca474af4 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require_relative '../lib/dsl'

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

    file '/tmp/test/wg/wg0.conf' do
      manage directory
      from template

      'the content is here and the result is <%= 1 + 2 %>'
    end

    file '/tmp/test/wg/wg1.conf' do
      manage directory
      from sourcefile

      './Rakefile'
    end
  end
end

desc 'Set up the /etc/hosts file'
task :hosts do
  configure do
    given { hostname is :earth }

    file '/etc/hosts.test' do
      line '192.168.1.101 foo'
    end
  end
end

desc 'foo'
task :foo do
  configure do
    file '/tmp/foo.txt' do
      line 'foo'
      requires file '/tmp/bar.txt'
    end

    file '/tmp/bar.txt' do
      'bar'
    end
  end
end