You have some Oracle Linux servers targeted by your ansible playbooks. You have your_playbook.yml that contains the following task: (The become and become_user instructions are not required to reproduce the error) If you got an error, just add the -vvv… Continue Reading →
For the purpose of this article, I give you an existing context. Imagine you have one server share.yourdomain.com that is an NFS server, and that shares a directory that we have named /heapdump Now imagine you have ten other linux… Continue Reading →
You ansible shell command is executed slightly differently from what you could write manually inside your linux console.For instance the following command executed manually will display nothing. But the same command with ansible will display itself: The reason is that… Continue Reading →
When you execute shell script with ansible module ansible.builtin.shell, bash is invoked as a non-interactive login shell. Consequently, environment variables from the user are not loaded. If you execute man bash, you’ll see: The solution is juste to explicitly load… Continue Reading →
Just be careful, chatGPT is a black box, you don’t know how it resolves your question. Furthermore on a question when you lack some knowledge, your no able to evaluate the quality of the answer. For instance, I’ve just knock… Continue Reading →
It happens because when ansible close it’s ssh connection, and when the ssh connection is closed the kernel sends SIGHUP to the controlling process of the ssh connection. But when executing startup.sh, the java process will receive the SIGHUP and… Continue Reading →
This happens when you use the become directive, for instance: The documentation says two things: The become_user set to user with desired privileges — the user you become, NOT the user you login as. Does NOT imply become: yes, to… Continue Reading →
Ansible ssh key connection Refer to https://nicodevlog.com/2022/05/21/public-key-authentication-on-linux-best-practices-a-more-secure-way-to-connect-to-your-hosts-without-login-and-password/ The advantages of an ssh key over a basic authentication are: no raw password (but you can encrypt passwords using ansible vault) one unique private key to connect to several nodes (but of… Continue Reading →
Note: for the whole article, I will work with a linux user called ansible on a host called also…ansible! 🙂 ssh-keygen When you use ssh-keygen you will generate a private and public key pair. And you’ll have to choose which… Continue Reading →
Note: The following commands are for RockyLinux, RedHat, CentOS, on other distros it will be almost the same. I’ve made the choice to connect to a user called ansible, and inside his home directory I’ve created a directory called ansible,… Continue Reading →