From cbf96f068216cd1c053bdc1cfec7f39447956725 Mon Sep 17 00:00:00 2001 From: Andrei Stepanov Date: Mar 28 2018 11:26:48 +0000 Subject: Drop 'ssh' from 'ansible_ssh_{host|port|user}' inventory variables Signed-off-by: Andrei Stepanov --- diff --git a/README.md b/README.md index f27d712..96ac7a1 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,10 @@ hierarchy of processes). For that purpose you can use environment variable `LOCK - add_host: name: "{{ vm_name }}" ansible_ssh_common_args: "{{ inventory_data.ansible_ssh_common_args }}" - ansible_ssh_host: "{{ inventory_data.ansible_ssh_host }}" + ansible_host: "{{ inventory_data.ansible_host }}" ansible_ssh_pass: "{{ inventory_data.ansible_ssh_pass }}" - ansible_ssh_port: "{{ inventory_data.ansible_ssh_port }}" + ansible_port: "{{ inventory_data.ansible_port }}" ansible_ssh_private_key_file: "{{ inventory_data.ansible_ssh_private_key_file }}" - ansible_ssh_user: "{{ inventory_data.ansible_ssh_user }}" + ansible_user: "{{ inventory_data.ansible_user }}" ansible_python_interpreter: "{% if vm_python_interpreter != '' %}{{ vm_python_interpreter }}{% else %}/usr/bin/python2{% endif %}" ``` diff --git a/inventory/standard-inventory-qcow2 b/inventory/standard-inventory-qcow2 index fd70634..9f0e127 100755 --- a/inventory/standard-inventory-qcow2 +++ b/inventory/standard-inventory-qcow2 @@ -179,9 +179,9 @@ def host(image): try: # The variables variables = { - "ansible_ssh_port": "{0}".format(port), - "ansible_ssh_host": "127.0.0.3", - "ansible_ssh_user": "root", + "ansible_port": "{0}".format(port), + "ansible_host": "127.0.0.3", + "ansible_user": "root", "ansible_ssh_pass": "foobar", "ansible_ssh_private_key_file": identity, "ansible_ssh_common_args": "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" diff --git a/inventory/standard-inventory-vagrant b/inventory/standard-inventory-vagrant index ea97111..dd4e5cc 100755 --- a/inventory/standard-inventory-vagrant +++ b/inventory/standard-inventory-vagrant @@ -174,7 +174,7 @@ def inv_host(box): # The variables variables = { - "ansible_ssh_user": "root", + "ansible_user": "root", "ansible_ssh_pass": ROOT_PASSWORD, "ansible_ssh_common_args": "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" } @@ -186,14 +186,14 @@ def inv_host(box): key, val = ln if key == "HostName": - variables["ansible_ssh_host"] = val + variables["ansible_host"] = val elif key == "Port": - variables["ansible_ssh_port"] = val + variables["ansible_port"] = val elif key == "IdentityFile": variables["ansible_ssh_private_key_file"] = val # verify we have all critical SSH configuration values - for key in ["ansible_ssh_host", "ansible_ssh_port", "ansible_ssh_private_key_file"]: + for key in ["ansible_host", "ansible_port", "ansible_ssh_private_key_file"]: if key not in variables: raise RuntimeError("failed to retrieve vagrant SSH configuration value {0}\n".format(key)) @@ -259,8 +259,8 @@ def inv_host(box): sys.stderr.write("\n") sys.stderr.write("DIAGNOSE: ssh -p {0} -o StrictHostKeyChecking=no" " -o UserKnownHostsFile=/dev/null" - "root@{1} # password: {2}\n".format(variables["ansible_ssh_port"], - variables["ansible_ssh_host"], + "root@{1} # password: {2}\n".format(variables["ansible_port"], + variables["ansible_host"], ROOT_PASSWORD)) sys.stderr.write("DIAGNOSE: kill {0} # when finished\n".format(os.getpid())) diff --git a/roles/standard-test-source/tasks/main.yml b/roles/standard-test-source/tasks/main.yml index a186f7e..f1ad9f0 100644 --- a/roles/standard-test-source/tasks/main.yml +++ b/roles/standard-test-source/tasks/main.yml @@ -3,7 +3,7 @@ add_host: name: executor ansible_connection: local - ansible_ssh_host: 127.0.0.1 + ansible_host: 127.0.0.1 ansible_ssh_connection: local - name: Extract package source code