Sorry for the long delay in responding.
I started out with 'two version of Ansible installed':
~$ apt list --installed | grep ansible
ansible/focal,now 2.9.6+dfsg-1 all [installed]
~$ python3 -m pip list | grep ansible
ansible 4.0.0
ansible-core 2.11.1
So I removed all of it:
pip uninstall ansible
pip uninstall ansible-core
sudo apt remove ansible
I installed it via APT, I am using Ubuntu 20.04.2 LTS Windows Subsystem for Linux.
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
I received the following error after installing it:
~$ ansible --version
-bash: /home/user/.local/bin/ansible: No such file or directory
So i removed it and installed it via PIP, and it runs this time:
~$ ansible --version
ansible [core 2.11.2]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/user/.local/lib/python3.8/site-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /home/user/.local/bin/ansible
python version = 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0]
jinja version = 2.10.1
libyaml = True
However the playbook still runs with the original error.
~$ python3 -m pip list
Package Version
---------------------------------- --------------------
ansible 4.2.0
ansible-core 2.11.2
attrs 19.3.0
Automat 0.8.0
bcrypt 3.2.0
blinker 1.4
certifi 2019.11.28
cffi 1.14.3
chardet 3.0.4
Click 7.0
cloud-init 21.2
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
constantly 15.1.0
cryptography 2.8
dbus-python 1.2.16
decorator 4.4.2
distro 1.4.0
distro-info 0.23ubuntu1
entrypoints 0.3
httplib2 0.14.0
hyperlink 19.0.0
idna 2.8
importlib-metadata 1.5.0
incremental 16.10.1
Jinja2 2.10.1
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
keyring 18.0.1
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
lxml 4.6.3
MarkupSafe 1.1.0
more-itertools 4.2.0
netifaces 0.10.4
nftables 0.1
nsx-policy-python-sdk 3.0.3.0.0.17723277
nsx-python-sdk 3.0.3.0.0.17723277
nsx-vmc-aws-integration-python-sdk 3.0.3.0.0.17723277
nsx-vmc-policy-python-sdk 3.0.3.0.0.17723277
oauthlib 3.1.0
packaging 20.9
paramiko 2.7.2
pexpect 4.6.0
pip 20.0.2
pyaoscx 2.0.0
pyasn1 0.4.2
pyasn1-modules 0.2.1
pycparser 2.20
pycrypto 2.6.1
PyGObject 3.36.0
PyHamcrest 1.9.0
PyJWT 1.7.1
PyNaCl 1.4.0
pyOpenSSL 19.0.0
pyparsing 2.4.7
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.5
python-debian 0.1.36ubuntu1
pyvmomi 7.0.1
PyYAML 5.3.1
requests 2.22.0
requests-unixsocket 0.2.0
resolvelib 0.5.4
SecretStorage 2.3.1
selinux 3.0
service-identity 18.1.0
setuptools 45.2.0
simplejson 3.16.0
six 1.14.0
slip 0.6.5
slip.dbus 0.6.5
sos 4.1
ssh-import-id 5.10
suds-jurko 0.6
systemd-python 234
Twisted 18.9.0
ubuntu-advantage-tools 27.0
ufw 0.36
unattended-upgrades 0.1
urllib3 1.25.8
vapi-client-bindings 3.5.0
vapi-common-client 2.19.0
vapi-runtime 2.19.0
vmc-client-bindings 1.36.0
vmc-draas-client-bindings 1.17.0
vSphere-Automation-SDK 1.51.0
wadllib 1.3.3
wheel 0.34.2
zipp 1.0.0
zope.interface 4.7.1
~$ python --version
Python 2.7.18
~$ python3 --version
Python 3.8.10
------------------------------
Don Rhodes
------------------------------
Original Message:
Sent: Jun 30, 2021 02:33 PM
From: Tiffany Chiapuzio-Wong
Subject: Ansible error, unterminated character set at position 0
Which python version are you using? Are you running this in a docker container at all?
In my experience when using the new Ansible versions (3/4) python 3.8 is required.
------------------------------
Tiffany Chiapuzio-Wong
Original Message:
Sent: Jun 30, 2021 05:18 AM
From: Kevin Zhu
Subject: Ansible error, unterminated character set at position 0
I got same error when i use ansible3 or 4 working with ansible aoscx ssh module.
for my case:
1. 2.9.23, everything including ssh/httpapi/built-in modules working good
2. ansible 3(ansible-base 2.10) or ansible 4(ansible-core):
1. built-in module works
2. httpapi modules works
3. network_cli, ssh module not working.
btw, there is only one ansible-base or ansible-core was running.
------------------------------
Kevin Zhu
Original Message:
Sent: Jun 29, 2021 01:20 AM
From: Tiffany Chiapuzio-Wong
Subject: Ansible error, unterminated character set at position 0
Hi all,
I've seen this error with multiple versions of Ansible installed (through a package installer as well as through a pip install). Can you ensure only 1 version of Ansible exists and try executing again?
Through package installer (Ubuntu):
`apt list --installed `
Through pip:
`python3 -m pip list`
Ensure there's only 1 ansible-base or ansible-core according to Ansible's documentation.
For instructions on how to install Ansible refer to their documentation here:
------------------------------
Tiffany Chiapuzio-Wong
Original Message:
Sent: Jun 24, 2021 10:23 AM
From: Shubhampaul Shubhampaul
Subject: Ansible error, unterminated character set at position 0
Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now.
------------------------------
Shubhampaul Shubhampaul
Original Message:
Sent: Jun 23, 2021 01:37 PM
From: Don Rhodes
Subject: Ansible error, unterminated character set at position 0
Hello,
Has anyone seen this error recently?
Running the playbook with -vvvv I get:
The full traceback is:File "/tmp/ansible_aoscx_config_payload_9q0pzltx/ansible_aoscx_config_payload.zip/ansible/module_utils/aoscx.py", line 397, in run_commandsreturn conn.run_commands(commands=commands, check_rc=check_rc)File "/tmp/ansible_aoscx_config_payload_9q0pzltx/ansible_aoscx_config_payload.zip/ansible/module_utils/connection.py", line 195, in __rpc__raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)fatal: [test-sw.colgate.edu]: FAILED! => changed=falseinvocation:module_args:after: nullbackup: falsebackup_options: nullbefore: nulldiff_against: nulldiff_ignore_lines: nullintended_config: nulllines: nullmatch: lineparents: nullprovider: nullreplace: linerunning_config: nullsave_when: modifiedsrc: nullmsg: unterminated character set at position 0
I recently upgrade to arubanetworks.aoscx_role (3.0.0)
$ ansible --version
ansible [core 2.11.1]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/user/.local/lib/python3.8/site-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /home/user/.local/bin/ansible
python version = 3.8.5 (default, May 27 2021, 13:30:53) [GCC 9.3.0]
jinja version = 2.10.1
libyaml = True
Non-AOSCX (role) based playbooks work without issue.
------------------------------
Don Rhodes
------------------------------