Ansible raises the error 'invalid or malformed argument', but the problem is in the code.
Posted by ads' corner on Friday, August 2, 2024
Ansible has a concept of handlers, which run at the end of a Playbook, when something changed. In certain situations it might be desired or necessary to have a handler listen to more than one signal name. In my example: I'm updating the Samba configuration, and before restarting smbd or nmbd I want to check the configuration. This configuration check handler must listen to both restart signals.
Posted by ads' corner on Monday, July 29, 2024
Switching laptops from Ubuntu to Manjaro Linux. One of the packages which I want to install is the Microsoft True Type Core Fonts. That works different in both distributions.
Posted by ads' corner on Thursday, July 11, 2024
Every time I peek into the webserver logfiles, I find quite a few 404 requests trying to figure out if certain exploits exist on this server. Now I get that these are automated attempts, and the number of requests coming from one IP show that they try several different exploits and path names. Nevertheless I thought that I don’t need this in my log, and on my webserver. fail2ban for the rescue.
Posted by ads' corner on Friday, December 9, 2022
Had a somewhat curious situation: need to run a task in Ansible in different user accounts, but I don't have 'sudo' or 'su' access, only ssh access for every account. Took me a moment to figure out how to do that.
Posted by ads' corner on Friday, August 12, 2022
For one of my *Ansible* Playbooks I need the group name associated with a specific group id. Turns out there is not much documentation online how to do this, and I had to test it out.
Posted by ads' corner on Sunday, June 12, 2022
For one project I need to insert the content of a local file into another file on the remote system, and the first file happens to be JSON. The JSON file is in compact format and is supposed to stay this way. When Ansible reads the content of the file, it determines that the content is JSON, and parses the content into the variable - and along the way is uncompressing the format. Not what I want. To keep the file content as string, it is necessary to tell Ansible to handle this as string.
Posted by ads' corner on Sunday, March 20, 2022
Was running in a stupid problem where Ansible (version 2.9.x) throws an error when a variable is defined.
Posted by ads' corner on Sunday, May 2, 2021
For testing I did spin up a couple of new virtual (Ubuntu 20.04 LTS) instances, installed PostgreSQL, and wanted to copy over a '.sql' file to install in the database. And ran into a meaningless error message.
Posted by ads' corner on Thursday, April 15, 2021
Ansible has a very useful module 'postgresql_ping' which checks connectivity to the database server. I'm using it in quite a few Playbooks as first step just to ensure that the database server is present - this fails early if there is a problem which otherwise just prevents the rest of the Playbook to work properly.
Posted by ads' corner on Wednesday, March 31, 2021