AWX Ansible =tower_cli.exceptions.TowerCLIError failed to parse some of the extra variables=

on osiux's blog

.org | .md | .gmi | .html

Estoy ejecutando un playbook de Ansible 1 que utiliza tower-cli 2 para interactuar con un servidor AWX 3 y me encontré varios minutos intentando corregir este error:

TASK [debug] *******************************************************************************
task path: /mnt/data/git/ansible-tower-cli/inventory.yml:10
ok: [localhost] => {
"awx_config_file": "~/.tower_cli.cfg"
META: ran handlers


TASK [CreateOrganization] ********************************************************************
task path: /mnt/data/git/ansible-tower-cli/inventory.yml:16
An exception occurred during task execution. To see the full traceback,
use -vvv. The error was: verify_ssl=false fatal: [localhost]: FAILED!
=> {
"changed": false,
"module_stderr": "Traceback (most recent call last):
File /tmp/ansible_aipolz/,
line 103, in <module> main()
File /tmp/ansible_aipolz/,
line 84,
in main tower_auth = tower_auth_config(module)
line 57,
in tower_auth_config
line 105,
in string_to_dict 'variables.\variables: \%s' %var_string
tower_cli.exceptions.TowerCLIError: failed to parse some of the extra variables.variables:
"module_stdout": "",
"rc": 1
} to retry, use: --limit @/mnt/data/git/ansible-tower-cli/inventory.retry


PLAY RECAP **********************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1

El problema es con el formato del archivo ~/.tower_cli.cfg y es necesario corregir lo siguiente:


# cat ~/.tower_cli.cfg
[general]              <--- ERROR delete line!
host=     <--- ERROR add http://hostname:port
password = xxxxxxxxxxx <--- ERROR trim whitespaces!


# ansible --version
ansible 2.5.13
config file = None
configured module search path = [u'/home/osiris/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]


# tower-cli version
Tower CLI 3.3.3
API v2
AWX 2.1.0
Ansible 2.7.1


@ 00:38 hs