kvm: move slapos.cookbook:kvm recipe to buildout+jinja
[slapos.git] / software / kvm / instance.cfg.in
1 [buildout]
2 parts =
3   switch-softwaretype
4
5 eggs-directory = ${buildout:eggs-directory}
6 develop-eggs-directory = ${buildout:develop-eggs-directory}
7
8 [switch-softwaretype]
9 recipe = slapos.cookbook:softwaretype
10 default = $${:kvm}
11 kvm-cluster = $${dynamic-template-kvm-cluster:rendered}
12 kvm = $${dynamic-template-kvm:rendered}
13 nbd = ${template-nbd:output}
14 frontend = ${template-frontend:output}
15
16 kvm-resilient = $${dynamic-template-kvm-resilient:rendered}
17 kvm-import = ${template-kvm-import:output}
18 kvm-export = $${dynamic-template-kvm-export:rendered}
19
20 # Used for the test of resiliency. The system wants a "test" software_type.
21 test = $${dynamic-template-kvm-resilient-test:rendered}
22
23 frozen = ${instance-frozen:output}
24 pull-backup = ${template-pull-backup:output}
25
26 # XXX - If this configuration is not generated by slapgrid, use empty values
27 [storage-configuration]
28 storage-home = 
29   
30 [network-information]
31 global-ipv4-network = 
32
33 [slap-configuration]
34 recipe = slapos.cookbook:slapconfiguration.serialised
35 computer = $${slap-connection:computer-id}
36 partition = $${slap-connection:partition-id}
37 url = $${slap-connection:server-url}
38 key = $${slap-connection:key-file}
39 cert = $${slap-connection:cert-file}
40 storage-home = $${storage-configuration:storage-home}
41
42 [jinja2-template-base]
43 recipe = slapos.recipe.template:jinja2
44 rendered = $${buildout:directory}/$${:filename}
45 extensions = jinja2.ext.do
46 mode = 0644
47 extra-context =
48 context =
49     key develop_eggs_directory buildout:develop-eggs-directory
50     key eggs_directory buildout:eggs-directory
51     key ipv4 slap-configuration:ipv4
52     key ipv6 slap-configuration:ipv6
53     key global_ipv4_prefix network-information:global-ipv4-network
54     key tap_network_dict slap-configuration:tap-network-information-dict
55     key storage_dict slap-configuration:storage-dict
56     key slapparameter_dict slap-configuration:configuration
57     key computer_id slap-configuration:computer
58     raw openssl_executable_location ${openssl:location}/bin/openssl
59     $${:extra-context}
60
61 [dynamic-template-kvm-cluster-parameters]
62
63 [dynamic-template-kvm-cluster]
64 <= jinja2-template-base
65 template = ${template-kvm-cluster:location}/instance-kvm-cluster.cfg.jinja2.in
66 filename = template-kvm-cluster.cfg
67 extra-context =
68   section parameter_dict dynamic-template-kvm-cluster-parameters
69   raw logrotate_cfg ${template-logrotate-base:rendered}
70   raw template_content ${template-content:location}/${template-content:filename}
71   raw template_httpd_cfg ${template-httpd:rendered}
72   raw template_monitor ${monitor-template:output}
73
74 [dynamic-template-kvm]
75 recipe = slapos.recipe.template:jinja2
76 template = ${template-kvm:location}/instance-kvm.cfg.jinja2
77 rendered = $${buildout:directory}/template-kvm.cfg
78 extensions = jinja2.ext.do
79 context =
80     key develop_eggs_directory buildout:develop-eggs-directory
81     key eggs_directory buildout:eggs-directory
82     key global_ipv4_prefix network-information:global-ipv4-network
83     key slapparameter_dict slap-configuration:configuration
84     key storage_dict slap-configuration:storage-dict
85     key tap_network_dict slap-configuration:tap-network-information-dict
86     raw ansible_promise_tpl ${template-ansible-promise:location}/${template-ansible-promise:filename}
87     raw curl_executable_location ${curl:location}/bin/curl
88     raw dash_executable_location ${dash:location}/bin/dash
89     raw dcron_executable_location ${dcron:location}/sbin/crond
90     raw debian_amd64_netinst_location ${debian-amd64-netinst.iso:location}/${debian-amd64-netinst.iso:filename}
91     raw logrotate_cfg ${template-logrotate-base:rendered}
92     raw novnc_location ${noVNC:location}
93     raw netcat_bin ${netcat:location}/bin/netcat
94     raw openssl_executable_location ${openssl:location}/bin/openssl
95     raw python_executable ${buildout:executable}
96     raw qemu_executable_location ${kvm:location}/bin/qemu-system-x86_64
97     raw qemu_img_executable_location ${kvm:location}/bin/qemu-img
98     raw sixtunnel_executable_location ${6tunnel:location}/bin/6tunnel
99     raw template_httpd_cfg ${template-httpd:rendered}
100     raw template_content ${template-content:location}/${template-content:filename}
101     raw template_kvm_controller_run ${template-kvm-controller:location}/${template-kvm-controller:filename}
102     raw template_kvm_run ${template-kvm-run:location}/${template-kvm-run:filename}
103     raw template_monitor ${monitor-template:output}
104     raw websockify_executable_location ${buildout:directory}/bin/websockify
105 template-parts-destination = ${template-parts:destination}
106 template-replicated-destination = ${template-replicated:destination}
107 import-list = file parts :template-parts-destination
108               file replicated :template-replicated-destination
109 mode = 0644
110
111 [dynamic-template-kvm-resilient]
112 recipe = slapos.recipe.template:jinja2
113 template = ${template-kvm-resilient:location}/instance-kvm-resilient.cfg.jinja2
114 rendered = $${buildout:directory}/template-kvm-resilient.cfg
115 extensions = jinja2.ext.do
116 context =
117     key develop_eggs_directory buildout:develop-eggs-directory
118     key eggs_directory buildout:eggs-directory
119     key slapparameter_dict slap-configuration:configuration
120     raw curl_executable_location ${curl:location}/bin/curl
121 template-parts-destination = ${template-parts:destination}
122 template-replicated-destination = ${template-replicated:destination}
123 import-list = file parts :template-parts-destination
124               file replicated :template-replicated-destination
125 mode = 0644
126
127 [dynamic-template-kvm-export]
128 recipe = slapos.recipe.template:jinja2
129 template = ${template-kvm-export:location}/instance-kvm-export.cfg.jinja2
130 rendered = $${buildout:directory}/template-kvm-export.cfg
131 extensions = jinja2.ext.do
132 context =
133     key develop_eggs_directory buildout:develop-eggs-directory
134     key eggs_directory buildout:eggs-directory
135     raw kvm_template $${dynamic-template-kvm:rendered}
136     raw template_kvm_export ${template-kvm-export-script:location}/${template-kvm-export-script:filename}
137     raw pbsready_export_template ${pbsready-export:output}
138     raw gzip_binary ${gzip:location}/bin/gzip
139 mode = 0644
140
141 [dynamic-template-kvm-resilient-test]
142 recipe = slapos.recipe.template:jinja2
143 template = ${template-kvm-resilient-test:location}/instance-kvm-resilient-test.cfg.jinja2
144 rendered = $${buildout:directory}/template-kvm-resilient-test.cfg
145 context =
146     key develop_eggs_directory buildout:develop-eggs-directory
147     key eggs_directory buildout:eggs-directory
148     key slapparameter_dict slap-configuration:configuration
149     raw bin_directory ${buildout:bin-directory}
150 mode = 0644