I’m new to Ansible and I’m trying to set up an environment for authoring playbooks, that can be shared with a group. I tried following this: https://www.youtube.com/watch?v=C8908KSjn78. My first attempt resulted in an empty (init did not create a sample environment) ansible-navigator that has major problems communicating with docker (which I figure is why I have no environment). From what I’ve found on the web, the setup varies with how long ago it was written (think pre-2.11 navigator vs post-2.11 for example). Is there a good guide somewhere for setting up an Ansible dev server, step by step, on Ubuntu 22.04? Please, I would be eternally grateful.
All you need is the correct version of Python and pip, right? I used these steps on various OSes with no issue, not sure if Ubuntu was one of them ==> Installing Ansible — Ansible Documentation
Ansible-core appears to have installed without issue, it’s ansible-navigator that appears to have not installed properly. Again, the various how-to’s I’ve run across vary substantially according to version. As I mentioned in the title, I’m trying to duplicate the ansible Dev server, the same environment Red Hat uses in it’s learning environment.
2024-03-05T20:13:27.121521+00:00 ERROR 'ansible_navigator.image_manager.puller._log_message' Execution environment pull failed
2024-03-05T20:13:27.121890+00:00 ERROR 'ansible_navigator.image_manager.puller._log_message' permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=ghcr.io%2Fansible%2Fcreator-ee&tag=v0.22.0": dial unix /var/run/docker.sock: connect: permission denied
2024-03-08T19:48:06.301345+00:00 WARNING 'ansible_navigator.image_manager.puller._log_message' Image inspection failed, image assumed to be corrupted or missing
2024-03-08T19:48:06.302069+00:00 WARNING 'ansible_navigator.image_manager.puller._log_message' stdout: []
2024-03-08T19:48:06.302134+00:00 WARNING 'ansible_navigator.image_manager.puller._log_message' stderr: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/ghcr.io/ansible/creator-ee:v0.22.0/json": dial unix /var/run/docker.sock: connect: permission denied
2024-03-08T19:48:06.344442+00:00 ERROR 'ansible_navigator.image_manager.puller._log_message' Execution environment pull failed
2024-03-08T19:48:06.344595+00:00 ERROR 'ansible_navigator.image_manager.puller._log_message' permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=ghcr.io%2Fansible%2Fcreator-ee&tag=v0.22.0": dial unix /var/run/docker.sock: connect: permission denied
2024-03-08T19:48:21.213615+00:00 ERROR 'ansible_navigator.actions.collections._run_runner' docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=ansible_runner_e9f01ecb-d2c2-4a7e-99af-284cd373c172": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
2024-03-08T19:48:23.357003+00:00 ERROR 'ansible_navigator.actions.collections._parse' Unable to extract collection json from stdout
2024-03-08T19:48:39.480969+00:00 ERROR 'ansible_navigator.actions.config._run_runner' Error occurred while fetching ansible config (list): 'docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=ansible_runner_976d7db9-91eb-41f8-a725-5fd5ff937f55": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
'
2024-03-08T19:48:39.481294+00:00 ERROR 'ansible_navigator.actions.config._run_runner' Error occurred while fetching ansible config (dump): 'docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=ansible_runner_c48bb555-28de-41c2-882e-d880569b2d30": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
'
2024-03-12T12:24:14.253328+00:00 WARNING 'ansible_navigator.image_manager.puller._log_message' Image inspection failed, image assumed to be corrupted or missing
2024-03-12T12:24:14.254372+00:00 WARNING 'ansible_navigator.image_manager.puller._log_message' stdout: []
2024-03-12T12:24:14.254566+00:00 WARNING 'ansible_navigator.image_manager.puller._log_message' stderr: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/ghcr.io/ansible/creator-ee:v0.22.0/json": dial unix /var/run/docker.sock: connect: permission denied
2024-03-12T12:24:14.301930+00:00 ERROR 'ansible_navigator.image_manager.puller._log_message' Execution environment pull failed
2024-03-12T12:24:14.302145+00:00 ERROR 'ansible_navigator.image_manager.puller._log_message' permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=ghcr.io%2Fansible%2Fcreator-ee&tag=v0.22.0": dial unix /var/run/docker.sock: connect: permission denied
2024-03-12T12:24:22.487688+00:00 ERROR 'ansible_navigator.actions.config._run_runner' Error occurred while fetching ansible config (list): 'docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=ansible_runner_6dba9beb-fcf8-461c-ab1b-f3123547b81c": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
'
2024-03-12T12:24:22.487955+00:00 ERROR 'ansible_navigator.actions.config._run_runner' Error occurred while fetching ansible config (dump): 'docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=ansible_runner_3d49c9e6-c981-4fd0-9ec1-5dea6cef755a": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
'
FYI: ansible-navigator is running under my user, and I’m in the docker group
Fixed: Turned out that Docker and docker.socket under /var/run had the wrong permissions (no group permissions). Fixed that, rebooted, and ansible-navigator is now working.
jrglynn2: Ansible dev server uses Ansible-navigator, please refer to the Ansible dev server instructions in the original RedHat hyperlink. RedHat uses this environment for all their Ansible courses. Not only does it set up your environment for you, but it can publish your playbooks to Ansible Automation Server. You should try it.
Thanks for the info, but I have never had a need. If “Ansible Dev Server” and/or “Ansible Automation Server” are the new names for either the paid services or Tower, I don’t use any of that. I have used the link I provided (for 5 years), for setting up the free controller. Simple and effective (and free)
Well Ansible Dev Server is to give each member of your development team the same development environment. It is the combination of ansible-core, ansible-navigator and vscode server built to run on a kubernetes cluster. It is free.
(Side Note: I also found once I fixed the problem noted above, that the setup required ansible-builder (also free) as well to initialize the user setups with all the minutia required to make a playbook run under any environment.)
Ansible Automation Server, however, is not free, but our organization decided to go down that rabbit hole. Ansible Dev Server also hooks into it and can transfer playbooks back and forth seamlessly.