diff options
author | Jan Benedikt <j.benedikt@partner.samsung.com> | 2020-02-17 09:26:54 +0100 |
---|---|---|
committer | Jan Benedikt <j.benedikt@partner.samsung.com> | 2020-02-29 23:00:07 +0000 |
commit | 255d066ef39b24fc0da8776ee7aaefedc4b812e7 (patch) | |
tree | 4295d5c23f78311b6caf514a8c5c863d74f45fa8 /tools/cicdansible/roles/install | |
parent | f1d9816984b695fc4ae6a011c23c5f274385070e (diff) |
Specify Python in Ansible inventory template file
Created copy of inventory template due to set var of Python interpreter.
Python interpreter cannot be set in ansible.cfg file due to bug:
https://github.com/ansible/ansible/issues/45852
Issue-ID: OOM-1671
Signed-off-by: Jan Benedikt <j.benedikt@partner.samsung.com>
Change-Id: I9683a2a764e8c6696a39625a6ddc40cda20f9333
Diffstat (limited to 'tools/cicdansible/roles/install')
-rw-r--r-- | tools/cicdansible/roles/install/tasks/install.yml | 2 | ||||
-rw-r--r-- | tools/cicdansible/roles/install/templates/inventory.yml.j2 | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tools/cicdansible/roles/install/tasks/install.yml b/tools/cicdansible/roles/install/tasks/install.yml index 529e2acf..5c4bcd81 100644 --- a/tools/cicdansible/roles/install/tasks/install.yml +++ b/tools/cicdansible/roles/install/tasks/install.yml @@ -14,7 +14,7 @@ unarchive: src: "resources/{{ hostvars[groups['resources'][0]].resources_sw_filename }}" dest: "{{ installer_deploy_path }}" -#Generate ansible inventory and extra vars. +#Generate ansible inventory and extra vars - name: "Generate ansible inventory for installer" template: src: inventory.yml.j2 diff --git a/tools/cicdansible/roles/install/templates/inventory.yml.j2 b/tools/cicdansible/roles/install/templates/inventory.yml.j2 index faec5903..9f7e08f8 100644 --- a/tools/cicdansible/roles/install/templates/inventory.yml.j2 +++ b/tools/cicdansible/roles/install/templates/inventory.yml.j2 @@ -1,5 +1,8 @@ all: vars: +{% if hostvars['infra'].ansible_distribution in ["Debian","Ubuntu"] %} + ansible_python_interpreter: "/usr/bin/python3" +{% endif %} ansible_ssh_private_key_file: /root/.ssh/id_rsa ansible_ssh_common_args: "-o StrictHostKeyChecking=no" children: |