Problems (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on ansible-awx's Python /bin/python3 - ansible-awx

SUMMARY:
I has done the installation ansible-awx follow the instruction:
https://howto.lintel.in/install-ansible-tower-awx-centos-7/
ISSUE TYPE :
When i ran command ansible-playbook -i inventory install.yml -vv
in folder source awx /root/awx/installer
Bug Report :
TASK [local_docker : Start the containers] ********************************************************************************************************************************
task path: /root/awx/installer/roles/local_docker/tasks/compose.yml:39
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on ansible-awx's Python /bin/python3. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example via pip install docker or pip install docker-py (Python 2.6). The error was: No module named 'requests'"}
PLAY RECAP ****************************************************************************************************************************************************************
localhost : ok=13 changed=2 unreachable=0 failed=1 skipped=86 rescued=0 ignored=0
I try ran command with : ansible-playbook -i inventory install.yml -e 'ansible_python_interpreter=/usr/bin/python3'
But error the error appears similar above .
ANSIBLE VERSION
ansible 2.9.10
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, Apr 2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
OS: CentOS Linux release 7.8.2003 (Core)
Thanks for helping !

I've got the same error and I solved it installing python36-docker and docker-componse.
yum install python3 python36-docker -y
pip3 install docker-compose
then rerun:
ansible-playbook -i inventory install.yml

I run into the same issue, the following command executed on managed node (host) helped:
$ pip3 install docker

Related

Trouble Installing Python3.6 Virtual Environment on Ubuntu 22.04

Virtual environment stopped being created after upgrading to Ubuntu 22.04. Running the command
virtualenv venv -p python3.6
produces an error that did not occur in the previous version - Ubuntu 20.04.:
fail
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 84, in _get
result = get_wheel(
File "/usr/lib/python3/dist-packages/virtualenv/seed/wheels/acquire.py", line 26, in get_wheel
wheel = from_bundle(distribution, version, for_py_version, search_dirs, app_data, do_periodic_update, env)
File "/usr/lib/python3/dist-packages/virtualenv/seed/wheels/bundle.py", line 13, in from_bundle
wheel = load_embed_wheel(app_data, distribution, for_py_version, of_version)
File "/usr/lib/python3/dist-packages/virtualenv/seed/wheels/bundle.py", line 33, in load_embed_wheel
wheel = get_embed_wheel(distribution, for_py_version)
File "/usr/lib/python3/dist-packages/virtualenv/seed/wheels/embed/__init__.py", line 77, in get_embed_wheel
raise Exception((
Exception: Wheel for pip for Python 3.6 is unavailable. apt install python3-pip-whl
pip-21.3.1-py3-none-any.whl already present in /home/su/.local/share/virtualenv/wheel/3.6/embed/3/pip.json
created virtual environment CPython3.6.15.final.0-64 in 3225ms
creator CPython3Posix(dest=/home/su/Downloads/courses-app/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/su/.local/share/virtualenv)
added seed packages: pip==21.3.1, setuptools==59.6.0, wheel==0.37.1
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Can anyone help solve this problem?
The issue was resolved after installing the following packages:
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.6
sudo apt install libpython3.6-dev
sudo apt install python3.6-distutils

Ansible. Error during use docker-compose module. No module named 'docker'

I have a problem with run my playbook.yml with docker-compose module
---
- name: Deploying asistant application services
hosts: 1.1.1.1
vars:
dest_path: /my/path
become: yes
tasks:
- name: coping file docker-compose.yml
copy:
src: ./app/docker-compose.yml
dest: "{{ dest_path }}"
loop:
- docker-compose.yml
- name: run docker applications
docker_compose:
project_src: "{{ dest_path }}"
Python version
~$ python --version
Python 3.9.4
Ansible version
~$ ansible --version
ansible [core 2.11.6]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/rafal/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/rafal/.local/lib/python3.9/site-packages/ansible
ansible collection location = /home/rafal/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.4 (default, Nov 19 2021, 16:27:14) [GCC 8.3.0]
jinja version = 3.0.3
libyaml = True
I have also installed
~$ pip3 list | grep docker
docker 5.0.3
docker-compose 1.29.2
docker-py 1.10.6
docker-pycreds 0.4.0
dockerpty 0.4.1
Python3 in my system was installed in /user/local/bin
Python2.7.16 in my system was installed in /user/bin
Run command.
python3 $(which ansible-playbook) playbook.yml -u user -K -vvv
And result after run
"msg": "Failed to import the required Python library (Docker SDK for Python: docker above 5.0.0 (Python >= 3.6) or docker before 5.0.0 (Python 2.7) or docker-py (Python 2.6)) on ASSISTANT-DEV's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example via `pip install docker` (Python >= 3.6) or `pip install docker==4.4.4` (Python 2.7) or `pip install docker-py` (Python 2.6). The error was: No module named 'docker'"
}
Actually I don't have any idea what installed yet, or what, where a must set

How to install brew on a raspberry pi?

These are my raspberry pi OS, Kernel version and archtecture configs
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.10.52-v7l+
Architecture: arm
When I try to run their script(https://brew.sh/):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
I get
Homebrew on Linux is only supported on Intel processors!
and, whenever I try to run a brew command, I get:
-bash: brew: command not found
Homebrew for linux is called Linuxbrew. And the installation command that you need is:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
Please check out this link to get more info about it: https://github.com/Linuxbrew/brew
Also notice that while Linuxbrew can run on Raspberry Pi (32-bit ARM), no binary packages are available for it.
Here are my two cents on installing brew on RaspberryPi Zero W and RaspberryPi 3+ (RaspberryPi OS, bullseye).
$ # Install dependencies
$ sudo apt update -y && sudo apt upgrade -y
$ sudo apt install git
$ # Install rbenv and Ruby 2.6.8 (It takes 30-90 min.)
$ # As of 2022/06/09, ARM processors require Ruby 2.6.8.
$ # Check the gist below what is doing as well.
$ bash <(curl -sL https://gist.github.com/KEINOS/7101f542be23e5048198e2a27c3cfda8/raw/install_ruby_rpi.sh)
$ source ~/.bashrc
$ # Smoke test Ruby
$ ruby --version
ruby 2.6.8p205 (2021-07-07 revision 67951) [armv6l-linux-eabihf]
$ # Clone homebrew repo under /opt
$ sudo git clone --depth=1 https://github.com/Homebrew/brew /opt/homebrew
$ # Setup homebrew
$ sudo chown -R $(whoami) /opt/homebrew
$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc
$ source ~/.bashrc
$ # Full update to tap homebrew/core (It takes 30-90 min.)
$ brew update --force --verbose
$ # Smoke test brew
$ brew --version
Homebrew 3.5.1
Homebrew/homebrew-core (git revision 1d9fb5dd1e6; last commit 2022-06-09)
$ # Install "hello world" package which supports both 32bit and 64 bit ARM.
$ # - Source: https://github.com/KEINOS/Hello-Cobra
$ # - Formula: https://github.com/KEINOS/homebrew-Hello-Cobra
$ brew install KEINOS/Hello-Cobra/hello-cobra
***snip***
$ hello-cobra hello world
Hello, world!
$ # Env info of RaspberryPi Zero W
$ more /proc/device-tree/model
Raspberry Pi Zero W Rev 1.1
$ cat /etc/debian_version
11.3
$ uname -a
Linux rpi-zero 5.10.92+ #1514 Mon Jan 17 17:35:21 GMT 2022 armv6l GNU/Linux
$ whoami
pi
$ echo $SHELL
/bin/bash
$ # Env info of RaspberryPi 3+
$ more /proc/device-tree/model
Raspberry Pi 3 Model B Rev 1.2
$ cat /etc/debian_version
11.3
$ uname -a
Linux rpi-3pls 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux
$ whoami
pi
$ echo $SHELL
/bin/bash
Note that everything for brew is slow on ARM6. Patience is required not only when setting up linuxbrew, but also when installing packages using brew.
However, once the package has been successfully installed, it should work as fast as expected. So, I'd say it is worth trying linuxbrew on the ARM6 and ARM64 architectures.
References
ARM | Homebrew on Linux # docs.brew.sh
Untar anywhere | Installation # docs.brew.sh
How can I check the available version of a package in the repositories? # AskUbuntu.com
Installing Ruby versions | rbenv # GitHub
Raspberry Pi
Homebrew can run on Raspberry Pi (32-bit ARM), but no binary packages
(bottles) are available. Support for Raspberry Pi is on a best-effort
basis. Pull requests are welcome to improve the experience on
Raspberry Pi.
https://docs.brew.sh/Homebrew-on-Linux
Two comments on installing Homebrew on Raspberry Pi 400 Rev 1.0, Raspbian Debian 11.5.
For an unknown reason Homebrew installer requires exactly ruby version 2.6.8. My Pi has ruby 2.7.4 but that was not accepted
After installing 2.6.8 using the above hint (ruby-build available from the regular repository does not offer it, the next after 2.6.6 being 2.7.0), the brew update --force --verbose command was still failing on not finding 2.6.8. It was so because the 'brew' script has the PATH explicitely filtered to the system one, "/usr/bin:/bin:/usr/sbin:/sbin". Only after manually adding the path for ruby 2.6.8 did the update work. NB. the script was overwritten during the process so in order to install any package I had to add the path it again.
Any idea why it is "exactly 2.6.8" and not "2.6.8 or newer"?

Docker-compose: /usr/local/bin/docker-compose : line 1: Not: command not found

i'm trying to install Docker-compose on my Raspberry Pi 3+ which installed Raspbian buster.
I followed instruction on docker.com. After I entered command : sudo curl -L https://github.com/docker/compose/releases/download/1.20.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose.
It show a table for downloading
Result
It seems nothing downloaded, just have a file docker-compose saved in /usr/local/bin/docker-compose. When I opened it, it empty. Then I enter command docker-compose -v, it displayed error /usr/local/bin/docker-compose : line 1: Not: command not found.
Anyone have solution?
UPDATE:
Added the following command to my answer to download the LATEST version without specifying any version number at all so the download can be scripted.
curl -L "https://github.com/docker/compose/releases/download/$(curl https://github.com/docker/compose/releases | grep -m1 '<a href="/docker/compose/releases/download/' | grep -o 'v[0-9:].[0-9].[0-9]')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
It's a bit untidy, but it works. If you have a more elegant way than mine, ping it to me in the comments and I'll update my answer.
Just need to set the perms on the file:
chmod +x /usr/local/bin/docker-compose
Use the file command to validate that you pulled the correct arch for your system.
Intro:
Although docker-compose can be installed from a repo per the accepted answer, apt-cache show docker-compose reveals that as of 20211201 the repo version is only v1.25; about 2 years behind the current v2.1.1 release. In order to take advantage of more modern docker file versions, I needed to get the Github download working.
Short Answer:
The Docker documentation for Docker-Compose is WRONG. They forgot to preface the version number in the command with a "v"; consequently the download fails. Apparently this has been wrong for ages...
Longer Answer:
I ran the below command from the Docker-Compose documentation, and substituted the version "2.1.1" for "1.29.1" per Docker's guidance:
To install a different version of Compose, substitute 1.29.2 with the
version of Compose you want to use.
sudo curl -L "https://github.com/docker/compose/releases/download/2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
The resulting download was 9 KB for a 23 MB binary. Clearly the link was bogus. So I went to the root of the address used in the command "https://github.com/docker/compose/releases" and right-clicked on the version of Docker-Compose that I wanted and chose "Copy Link Address"
This revealed the link Docker was telling folks to use didn't have a "v" prefaced before the version number in the https:// address part of the command.
Solution:
Preface a "v" before the version number you want in the link as below and the command executes successfully:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
BTW, I too was downloading docker-compose for a Raspberry Pi using the aarch64 binary for Ubuntu 20.04 LTS. However, the missing "v" fix for the broken download address should work for any platform.
This is because on a raspberry pi the url part of the command results in
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-armv7l
Looking at the latest stable release at https://github.com/docker/compose/releases/tag/1.24.1 you can see there is no download for the armv7l architecture so the file is empty because there is nothing to download.
Will update answer once I figured out how to install docker-compose on Raspian.
Edit:
Via apt-get. Note: Currently (Nov. 8 2019) this installs version 1.21 which is not the latest available.
sudo apt-get install docker-compose
Via pip3. (Installs latest)
sudo apt-get install python3-pip
sudo pip3 install docker-compose
And then restart your system with
sudo shutdown -r

erroer while installing pl/java postgresql

I am trying to install pljava in my Linux system.
the below is my command and error
root#pega-5-instance:/etc/postgresql/9.1/share/pljava# su postgres -c "/usr/bin/psql -d pegadb -f /etc/postgre
sql/9.1/share/pljava/install.sql"<br>
CREATE SCHEMA<br>
GRANT<br>
psql:/etc/postgresql/9.1/share/pljava/install.sql:6: ERROR: could not access file "pljava": No such file or directory
I have installed java 64bit and pljava 64 bit.
please help me to solve the problem.