ansible auto user selection in playbook – Debian
I have a simple playbook that I run on new managed nodes for Ansible the playbook has 3 roles : create ansible admin user on destination host , copy ssh key , sets sudo no passwd for ansible user I…
I have a simple playbook that I run on new managed nodes for Ansible the playbook has 3 roles : create ansible admin user on destination host , copy ssh key , sets sudo no passwd for ansible user I…
This is my task. - name: Ensure fail2ban is running and enabled. ansible.builtin.service: name: fail2ban state: started enabled: true I am getting this error. 'fatal: [localhost]: FAILED! => {"changed": false, "msg": "get_service_tools not implemented on target platform"}' Need help!! Thanks…
I'm trying to install postgresql on my remote host using Ansible. I have 2 solutions, but both work only half as I expect them to work/turn out. 1. Solution one (using Ansible apt_repository module); - name: Get Postgres latest repository…
I want to add below docker log rotation specs into daemon.json file using ansible-playbook "log-driver": "json-file", "log-opts": { "max-size": "1m", "max-file": "4" } What if daemon.json is already present on the node which I am applying the playbook to. I…
I'm trying to create a list of interface names along with their mac addresses from a Debian 11 server, initially, I was trying to get the mac addresses in order only but now I realize I need a list that…
once again I'm trying to accomplish something with Ansible. I built a custom dict with variables for each server that looks like this. - name: Create and Add items to server_list set_fact: server_list: "{{ server_list | default({}) | combine ({…
I have the following data which is provided as extra vars. TCP,22,22,10.10.10.10/0 TCP,8080,8080,0.0.0.0/0 So, as: --extra-vars 'rules="TCP,22,22,10.10.10.10/0nTCP,8080,8080,0.0.0.0/0"' How can I create multiple rules block using Jinja based on the above CSV data? Update: I need to have one static rule…
I am trying to execute below command which is part of Docker installation, but it got stuck. The gpg part of the command got stuck, if I remove gpg after pipe, it works. --- - hosts: all become: yes tasks:…
In order to install Ansible on Centos 8; epel-release package needs to be installed. Due to Centos8 end of life, no new packages and security updates are not maintained and all repos has moved under vault.centos.org thus CentOS-* repos need…
I have created roles to install httpd. But the status is always 'ok=1' instead of 'changed=1' How should I actually install httpd and get a status of 'changed=1' master.yml-> - name: playbook hosts: webservers become: yes roles: -tasks tasks.yml-> -…