resilient stack/kvm: add ignore-known-hosts-file parameter.

parent 8bc96bdb
...@@ -244,7 +244,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -244,7 +244,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
promise_dict) promise_dict)
path_list.append(promise) path_list.append(promise)
known_hosts_file[parsed_url.hostname] = entry['server-key'] # Create known_hosts file by default.
# In some case, we don't want to create it (case where we share IP mong partitions)
if not self.isTrueValue(self.options.get('ignore-known-hosts-file')):
known_hosts_file[parsed_url.hostname] = entry['server-key']
notifier_wrapper_path = os.path.join(self.options['wrappers-directory'], slave_id) notifier_wrapper_path = os.path.join(self.options['wrappers-directory'], slave_id)
rdiff_wrapper_path = notifier_wrapper_path + '_raw' rdiff_wrapper_path = notifier_wrapper_path + '_raw'
......
...@@ -108,7 +108,7 @@ on-update = true ...@@ -108,7 +108,7 @@ on-update = true
[template-kvm-resilient-test] [template-kvm-resilient-test]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm-resilient-test.cfg.jinja2 url = ${:_profile_base_location_}/instance-kvm-resilient-test.cfg.jinja2
#md5sum = 8b6bd057721a8e4d84c5cd62a97cffe6 md5sum = 166d08a8b7455180975a5a604a2bdeb2
mode = 0644 mode = 0644
download-only = true download-only = true
on-update = true on-update = true
......
...@@ -40,6 +40,12 @@ ...@@ -40,6 +40,12 @@
"description": "Amount of backup(s) to create. Each backup consists of a Pull Backup Server and a clone.", "description": "Amount of backup(s) to create. Each backup consists of a Pull Backup Server and a clone.",
"type": "integer", "type": "integer",
"default": 2 "default": 2
},
"ignore-known-hosts-file": {
"title": "Ignore known_hosts file",
"description": "Set either to fill known_hosts file for ssh or not. Useful if main instance and PBS are using the same IP (slapos proxy, webrunner).",
"type": "boolean",
"default": false
} }
} }
} }
......
...@@ -60,6 +60,7 @@ config-virtual-hard-drive-url = ${slap-parameter:virtual-hard-drive-url} ...@@ -60,6 +60,7 @@ config-virtual-hard-drive-url = ${slap-parameter:virtual-hard-drive-url}
config-virtual-hard-drive-md5sum = ${slap-parameter:virtual-hard-drive-md5sum} config-virtual-hard-drive-md5sum = ${slap-parameter:virtual-hard-drive-md5sum}
config-resiliency-backup-periodicity = */5 * * * * config-resiliency-backup-periodicity = */5 * * * *
config-resilient-clone-number = 1 config-resilient-clone-number = 1
config-ignore-known-hosts-file = true
return = ipv6 return = ipv6
# XXX What to do? # XXX What to do?
sla-computer_guid = ${slap-connection:computer-id} sla-computer_guid = ${slap-connection:computer-id}
......
...@@ -63,13 +63,13 @@ mode = 0644 ...@@ -63,13 +63,13 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-pull-backup.cfg.in url = ${:_profile_base_location_}/instance-pull-backup.cfg.in
output = ${buildout:directory}/instance-pull-backup.cfg output = ${buildout:directory}/instance-pull-backup.cfg
md5sum = 08b80d1b7beb1610077151904526a2ec md5sum = 3866b0d4d2872f693b7d9519a668e6bc
mode = 0644 mode = 0644
[template-replicated] [template-replicated]
recipe = slapos.recipe.download recipe = slapos.recipe.download
url = ${:_profile_base_location_}/template-replicated.cfg.in url = ${:_profile_base_location_}/template-replicated.cfg.in
md5sum = a21d751078dbf1fc80ecb93a6f499287 md5sum = c781ae17375c26b08b2a11bd9b800db8
mode = 0644 mode = 0644
destination = ${buildout:directory}/template-replicated.cfg.in destination = ${buildout:directory}/template-replicated.cfg.in
......
...@@ -136,6 +136,7 @@ run-directory = $${basedirectory:run} ...@@ -136,6 +136,7 @@ run-directory = $${basedirectory:run}
# XXX: this should be named "notifier-host" # XXX: this should be named "notifier-host"
notifier-url = http://[$${notifier:host}]:$${notifier:port} notifier-url = http://[$${notifier:host}]:$${notifier:port}
slave-instance-list = $${slap-parameter:slave_instance_list} slave-instance-list = $${slap-parameter:slave_instance_list}
ignore-known-hosts-file = $${slap-parameter:ignore-known-hosts-file}
#---------------- #----------------
...@@ -235,6 +236,7 @@ identity-file = $${basedirectory:ssh-home}/id_rsa ...@@ -235,6 +236,7 @@ identity-file = $${basedirectory:ssh-home}/id_rsa
[slap-parameter] [slap-parameter]
slave_instance_list = [] slave_instance_list = []
ignore-known-hosts-file = false
......
...@@ -154,6 +154,7 @@ software-type = pull-backup ...@@ -154,6 +154,7 @@ software-type = pull-backup
[request-pbs-{{namebase}}-{{id}}] [request-pbs-{{namebase}}-{{id}}]
<= request-pbs-common <= request-pbs-common
name = PBS ({{namebase}} / {{id}}) name = PBS ({{namebase}} / {{id}})
config-ignore-known-hosts-file = ${slap-parameter:ignore-known-hosts-file}
return = ssh-key notification-url feeds-url return = ssh-key notification-url feeds-url
slave = false slave = false
{% if sla_parameter_dict == {} -%} {% if sla_parameter_dict == {} -%}
...@@ -231,6 +232,7 @@ sla-instance_guid = ${request-pbs-{{namebase}}-{{id}}:instance_guid} ...@@ -231,6 +232,7 @@ sla-instance_guid = ${request-pbs-{{namebase}}-{{id}}:instance_guid}
{{namebase}}{{id}}-computer-guid = {{namebase}}{{id}}-computer-guid =
pbs-{{namebase}}{{id}}-computer-guid = pbs-{{namebase}}{{id}}-computer-guid =
{% endfor %} {% endfor %}
ignore-known-hosts-file = false
{% endmacro %} {% endmacro %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment