X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=descriptor-packages%2Ftools%2Fcharm-generator%2Fgenerator%2Fansible-charm%2Ftemplates%2Fansible_lib.py.j2;h=afbf162d5edb307e004d30b27315fd6f2f553599;hb=5342d2d18451cc8756294f1ee8b278d4a3b76150;hp=7492c6ded9c8d70b11cce69ddce9801ff3f14a37;hpb=6c961fa5d455f78dad68f64a45aa866e6944f636;p=osm%2Fdevops.git diff --git a/descriptor-packages/tools/charm-generator/generator/ansible-charm/templates/ansible_lib.py.j2 b/descriptor-packages/tools/charm-generator/generator/ansible-charm/templates/ansible_lib.py.j2 index 7492c6de..afbf162d 100644 --- a/descriptor-packages/tools/charm-generator/generator/ansible-charm/templates/ansible_lib.py.j2 +++ b/descriptor-packages/tools/charm-generator/generator/ansible-charm/templates/ansible_lib.py.j2 @@ -49,6 +49,7 @@ def create_hosts(cfg, hosts): with open(inventory_path, 'w') as f: f.write('[{}]\n'.format(hosts)) h1 = '{0} ansible_connection=ssh ansible_ssh_user={1} ansible_ssh_pass={2} ' \ + 'ansible_ssh_private_key_file=~/.ssh/id_juju_sshproxy ' \ 'ansible_python_interpreter=/usr/bin/python3\n'.format(cfg['ssh-hostname'], cfg['ssh-username'], cfg['ssh-password']) f.write(h1) @@ -63,6 +64,11 @@ def create_ansible_cfg(): # logs playbook execution attempts to the specified path f.write('log_path = /var/log/ansible.log\n') + f.write('[ssh_connection]\n') + f.write('control_path=%(directory)s/%%h-%%r\n') + f.write('control_path_dir=~/.ansible/cp\n') + + # Function to find the playbook path def find(pattern, path): result = ''