Questions tagged [ansible]
Ansible is an automation tool ("IT orchestration engine", per the company web site) for the deployment and configuration of applications and systems.
500
questions
2
votes
0
answers
21
views
Update password-auth Using Ansible
I would like to update /etc/pam.d/password-auth using Ansible to have the following line (or a similar one with the remember=5 argument added)
password requisite pam_pwhistory.so remember=5
If a ...
0
votes
1
answer
36
views
Ansible AWX v17.0.1 running against EC2 instance -- ModuleNotFoundError: No module named 'ansible.module_utils.six.moves'
I am trying to run a simple Ansible playbook against an EC2 instance using AWX. My Ansible AWX is version 17.0.1 (running in Docker, not the Kubernetes version). I ran a 'pip3 list | grep six' and it ...
0
votes
0
answers
40
views
Automate Rocky Linux 9 installation through iLo
We have an HP iLo server and we want to automate the installation process of Rocky Linux 9 OS on it. Originally, we started using Ansible ran from a host machine, however we ran into issues when ...
2
votes
1
answer
3k
views
Ansible error "No module named 'ansible.module_utils.six.moves'"
I used a Fedora 39 machine to manage a Fedora 39 machine, with an Ansible playbook. This worked OK.
I tried to use Ubuntu 22.04 to run the same playbook, targeting the same Fedora 39 machine. It ...
0
votes
1
answer
43
views
Passwordless Authentication for Ansible
I have installed ansible and created new users for controller and remote hosts. Have set up the below steps, but getting error, can anyone suggest ??
Entered user using visudo, for both controller ...
0
votes
0
answers
81
views
What is a difference between an id set-up to use sesu vs. being added to sudoers file?
We are upgrading Confluent version in production, where the id we have to use is set-up with sesu vs. in lower environments, the id that was used to execute Confluent provided ansible playbooks was ...
0
votes
0
answers
77
views
Ansible uri: send jinja template output as HTTP body
I have an ansible playbook that generates a file using a jinja2 template:
- delegate_to: localhost
ansible.builtin.template:
src: metrics.j2
dest: metrics.txt
It writes the file with ...
1
vote
1
answer
76
views
Ansible evaluate list of tab separated strings
I am running a command, after which stdout is captured in a variable. The command output lists values separated by tabs. So I have something like
var.stdout_lines: [
"a1\tb1\tc1",
"...
1
vote
1
answer
110
views
using tabs within block for ansible blockinfile module
I want to output some text with tab as separator using ansible
here's task snippet
- name: Create output file
blockinfile:
block: |
Some text\tmore text
path: '{{ playbook_dir }}/...
1
vote
1
answer
46
views
Forcing Server Reboots if not rebooted within X days of patching (Azure Hosted)
I host numerous RHEL 8 servers in the Azure environment. I am using a Red Hat Satellite VM to patch servers and then I rely on the owners to reboot once patching is complete. I want to implement a ...
0
votes
1
answer
36
views
create dictionary of the play_hosts and their eth0 IP address in ansible
How would I create a list of all hosts in the play and their eth0 IP address?
I would like a list like this:
host2ip:
- host1: 10.0.0.1
- host2: 10.0.0.2
- host3: 10.0.0.3
-1
votes
2
answers
123
views
Ansible synchronize module is not replacing user variable with exact user name
I tried many ways to fix the below problem, but I was not lucky enough.
I have the below inventories;
#cat inventory/common/group_vars/all/inventory_pwd.yml
remote1_user: "devops"
#cat ...
0
votes
1
answer
235
views
Ansible - Regex in Fetch?
I'm building an ansible playbook to copy a checklist from this file and moving it to another file.
I'm relatively new to ansible. Originally, I used the Copy plugin but saw Fetch may be more up my ...
0
votes
2
answers
143
views
Edit configuration files idempotently
When editing configuration files, such as /etc/sysctl.conf for example, it is often useful to do the update in an idempotent way, meaning that if the script is executed multiple times, you don't end ...
0
votes
1
answer
46
views
ansible-doc getting started?
Is there a vimtutor eqvivalent to ansible?
I know I can read up on the syntax of a particular module using ansible-doc <module> - but what if I can't recall the module name?
If I find myself ...