ansible module actions without install - installation

I'm writing an Ansible playbook to configure new machines for our developing environment.
If I want to install postgresql using homebrew, I would use Ansible's given homebrew model to achieve this task.
But before I run this task, should I have a task that will install homebrew first?
If this is the case, how can I install homebrew using the command or shell Ansible module, which will normally prompt for a user input during the process of installation?

Yes, you have to install Homebrew first. The homebrew Ansible module documentation is not clear about that; if you check its source code it fails if it can’t find Homebrew and it doesn’t try to install it for you.
There already are answers on how to bypass the prompt in Homebrew’s install script. There are also other ways of installing Homebrew like downloading it as a tarball and un-taring it somewhere (which you can do with the unarchive Ansible module) or cloning its source code using git.

Related

pip install psd-tools3 => FileNotFoundError: [Errno 2] No such file or directory

I was trying to install Ursina but I was having trouble getting all the required packages I needed to run my code properly. Come to find out, there's a package that refuses to install called 'psd-tools3' that won't install, no matter what I do.
I've been using cmd commands like 'pip install psd-tools3' and 'pip3 install psd-tools3' but no other commands work (i.e. 'sudo pip install psd-tools3' doesn't work because my PC doesn't know what 'sudo' means and doesn't run). I've tried installing required packages for this package, but nothing works. It just keeps giving me this error:
enter image description here
I would really appreciate the help with this problem. All I can really assume is that the Python file '_version' hasn't been created and that's what's throwing the whole program off. If there is a way to add this manually and then install it, I would appreciate steps to do that as well.
I was running this on a Lenovo Thinkpad (Windows 10) on Python 3.10 (I also have Python 3.8.3 but that was installed with the 3.10) and I made sure all packages and pip are up-to-date. Still having this problem and I don't know why.
Seems to me like the issue is on the side of the maintainers of psd-tools3.
For example, looking at the content of the latest source distribution on PyPI, we can see that it does not contain any _version.py file.
This needs to be solved by the project's maintainers, but they do not have a ticket tracker. On the other hand there seems to be an "Author" email address on the project's PyPI page as well as in the project's setup.py script.
A solution might be to clone the project's source code repository (with git), and try to install from the local clone.
Just simply try
pip install psd-tools3==1.9.0
Or
pip install psd-tools3==1.8.2
This should work on your pc as well. I was having same issue, and then I tried this It worked for me

How to install pyez from local directory

I have to install pyez using pip. This at least is stated as requirement to use the role Juniper.junos to run ansible commands against Juniper routers. I'm using cygwin on a windows laptop without any adminrights in a corporate network. The problem is, I cannot use the corporate proxy because of that proprietary Microsoft NTLM protocol so a simple "pip install junos-eznc" is not possible. But what I could do is download the software, tarball or whatever and run pip against that downloaded stuff. I tried several things and failed miserably and google doesn't return anything useful. Can anyone help? What am I supposed to do to get that installed successfully? Many thanks in advance.
Youcan download required package and install it like this
pip install <file_name>
I solved it.
First issue: Proxy
px.exe on https://github.com/genotrance/px/releases.
Second issue: missing libs:
I had to install several libs and make on cygwin in order to get junos-eznc installed:
libxml2-devel
libxslt-devel
libffi-devel
libssl-devel
make
Third issue: cryptography
Don't use latest version of cryptography because it'll need rust which is pita on cygwin
pip install cryptography==3.2
... and then ...
pip install junos-eznc
After that, installation of ...
ansible-galaxy install Juniper.junos
... was quite smooth

Ansible pass value to installation commandline gui

How do I pass value to the commandline-gui prompt?
Like I typically install LAMP on a fresh Ubuntu using the following command.
sudo apt-get install lamp-server^ phpmyadmin
And during install I am asked for a few inputs as below
So how do I pass/input values from a playbook?
When using Ansible, you would generally install the packages non-interactively, like this [1]:
- command: apt-get -y install lamp-server^ phpmyadmin
environment:
DEBIAN_FRONTEND: noninteractive
This will suppress any interactive configuration prompts during the
install. You can then perform configuration tasks after the fact using
Ansible, either by directly manipulating files etc. or by using the
debconf module.
If you're not familiar with debconf, this question has some information about interacting with the package configuration system.
[1] Actually, you would more often use the package module, but that doesn't support package groups like lamp-server^.

How to install eclim with brew or other package manager?

I am trying to install eclim to my system for code completion in vim. But as far as the eclim website has mentioned, the only installation method seems to be downloading the bin or source code to your system and executing the installation command manually. But I really hate installing stuff in this way as it pollutes your system directories. I tried to use brew but there doesn't seem to be a formula named "eclim". So is there really no way for me to install eclim with a package manager on mac?
I tried to use brew but there doesn't seem to be a formula named "eclim". So is there really no way for me to install eclim with a package manager on mac?
Write the missing formula.

Ansible insatllation through brew and pip in mac

What is the difference between brew installation and pip installation in mac
Is there any supporting packages ?
Please give me some good ways to install ansible
brew install ansible
I prefer a installation via brew. I see the following pro's:
integration better geared towards mac (pip is more general purpose)
I try to install everything via brew (not pip for python, npm for javasscript...)
upgrade mechanism seems better to me (as far as I know upgrading every pip package is a bit hacky)
The ansible documentation recommends installation via pip :
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#control-node-requirements
I trust the product documentation more than the hearsay. Arguments like "I try to install everything via brew" do not apply here.
I recommend using pip as well, with a good python versions management and virtual environment.
I am using myself a combination of pyenv + venv (the latter is a module in recent versions of python in the standard library) and run Ansible on a control node in Mac OS in a python virtual env. It gives full control and definitely is not "hacky". The brew way is relying on system python on the other hand puts ansible in a Cellar site packages, ties it to a particular version of python with all its consequences and surprises.
To the OP - please read the ansible user guide and getting started documentation first before asking "please give me one sample".

Resources