def create_consul_client_init_script(self, tinc_network_name):
""" creates the consul client init file """
log_green('create consul client init script ...')
with settings(
hide('stdout', 'running'),
host_string=self.host_string,
private_key_filename=self.private_key,
):
consul_init_file = '/etc/systemd/system/consul-client.service'
upload_template(filename='consul-init-client.j2',
template_dir='templates',
destination=consul_init_file,
use_sudo=True,
use_jinja=True,
backup=False,
context={'tinc_network_name': tinc_network_name,
'node_ip': self.tinc_ip})
sudo('systemctl daemon-reload')
sudo('systemctl enable consul-client')
评论列表
文章目录