Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 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 ...
shepster's user avatar
  • 101
0 votes
1 answer
28 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 ...
Swampcritter's user avatar
0 votes
0 answers
35 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 ...
eur's user avatar
  • 1
2 votes
1 answer
2k 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 ...
sourcejedi's user avatar
  • 51.1k
0 votes
1 answer
42 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 ...
Piyush Nikhade's user avatar
0 votes
0 answers
80 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 ...
adbdkb's user avatar
  • 103
0 votes
0 answers
72 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 ...
queeg's user avatar
  • 212
1 vote
1 answer
71 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", "...
queeg's user avatar
  • 212
1 vote
1 answer
101 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 }}/...
Sollosa's user avatar
  • 1,951
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 ...
Jared's user avatar
  • 11
0 votes
1 answer
35 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
Daniel Kupfer's user avatar
-1 votes
2 answers
114 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 ...
aneeshdevcube's user avatar
0 votes
1 answer
228 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 ...
shottypop's user avatar
0 votes
2 answers
142 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 ...
user000001's user avatar
  • 3,645
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 ...
azzid's user avatar
  • 1,000
0 votes
1 answer
58 views

command center with restricted access to servers

I am looking for an automation approach: I have many linux servers and I want to be able to run some scripts on them without requiring to login to servers via ssh and run the tasks manually, I want to ...
zxsimba's user avatar
  • 13
1 vote
1 answer
277 views

Apt repositories. How 'Architectures' option works. How to determine which value may be used?

I am using ansible to set up two apt repositories on my Ubuntu_22.04 nodes. In ansible there is a var called {{ ansible_architecture }} which gives: aarch64 in this case. I used it to set up two repos ...
ext0101's user avatar
  • 11
0 votes
1 answer
49 views

Why isn't this command from this script run by the user specified by doas -u when this script is copied and run by an ansible playbook?

I wrote a simple playbook, open-links.yml, that is meant to run a script on one of my remote hosts: - name: Run Bash script hosts: myhosts gather_facts: false vars: au: "j" tasks:...
John Smith's user avatar
1 vote
0 answers
37 views

delete all folders containing deployfiles but not containing name DEV in absolute path

I would like a generic/posix/ansible solution to the below requirement for non-windows(preferably Solaris and Linux) -> I wish to list all files under /web/bea_apps/dev/TomcatNode01/deploy -> ...
Ashar's user avatar
  • 511
0 votes
1 answer
953 views

Ansible: No package matching 'docker-ce' is available

I have ansible playbook that suppose to install Docker on Oracle Cloud powered by Ampere (arm) that runs arm version of Ubuntu. The playbook is the following: - name: Set sudo set_fact: ...
Jan Pips's user avatar
2 votes
2 answers
684 views

semaphore (gui ansible) can forward root password

I am having this yaml for ubuntu Cleaner --- - name: Clean up system files hosts: pc remote_user: user become: yes vars: ansible_become_password: "{{ vault_password }}" ...
Mix tutor's user avatar
  • 120
0 votes
2 answers
333 views

Why can I run a playbook successfully as root but NOT as the user who owns the playbook?

I am trying to run a playbook and part of the playbooks job is to add a firewall port. What is the best way to do this? I get this error with the lineinfile module: - name: Ensure specific port ...
jspaine's user avatar
  • 11
0 votes
1 answer
643 views

Installing Python 3.9 on RHEL 7 Using Ansible 2.9.27

I need to install Python 3.9 on RHEL 7 system ( about 10 servers in each environment ) and then update / install Ansible 2.11 on the system. This is in preparation to upgrade Confluent version on ...
adbdkb's user avatar
  • 103
0 votes
0 answers
55 views

Why does sudo take a long time if there is a mismatch between /etc/hosts file and the actual hostname?

https://askubuntu.com/questions/1343609/sudo-unable-to-resolve-host-hostname-temporary-failure-in-name-resolution On Debian 12, I changed the hostname using ansible's hostname module. After that, any ...
rocky_alpine's user avatar
0 votes
1 answer
102 views

R Packages won't install via ansible (ALMA Linux 8)

Problem I would like to use ansible to provision a virtual box. This box will need to do multiple things, but it needs to have R installed as well as some specific packages that aren't included in ...
Hugh Warden's user avatar
0 votes
1 answer
93 views

Ansible: Inline data for file-update

I need to update some files via Ansible playbook. Normally my playbook would connect to the site where the new files are stored and transfers them. The question is if there is a way to have the ...
chris01's user avatar
  • 615
1 vote
2 answers
143 views

Systemd: provide password noninteractively to homectl

I would like to activate a systemd-homed home via ansible, how can I provide the password to the systemd password agent programmatically? It seems that I cannot simply pipe the password to homectl ...
Gamification's user avatar
0 votes
1 answer
98 views

cephadm - how to separate ssh network from monitor network

In my company, for several years we were using Ceph while using ceph-ansible as the deployer (and for upgrade, scale operations, etc). Recently I was assigned to migrating to 'cephadm' for ...
Itay R's user avatar
  • 1
-2 votes
1 answer
567 views

How to modify nginx configuration with ansible?

I want to add websites with SSL-certificates and URL-redirects to my running nginx-server. I thought of adding a config per website to nginx/conf.d/newsite.conf and then restarting nginx, but I ...
wellumies's user avatar
0 votes
0 answers
115 views

run put queries on Elasticsearch host from ansible host

When I run any GET queries, it runs fine. for instance - name: run curl query on ES host uri: url: "http://localhost:9200" method: GET return_content: yes url_username: ...
Sollosa's user avatar
  • 1,951
0 votes
1 answer
100 views

ansible conditional issues

this playbook gets total RAM, and based on that sets two variables, say A & B A is 40% of total RAM B is 60% of total RAM task is, if A greater than or equal to 32, then A must be 32, but if is ...
Sollosa's user avatar
  • 1,951
0 votes
0 answers
388 views

Disable inventory-cache of ansible-playbook

I am running a playbook (no matter what, it is loggin into an other machine by SSH). ansible-playbook -i inventory.ini -l myhost1 myplaybook.yml For that I am using an inventory-file. myhost1 ...
chris01's user avatar
  • 615
0 votes
2 answers
1k views

Does ansible actually use 'include' as keyword?

I inherited a playbook like file thing.yaml with the following content: --- - include: one.yaml - include: two.yaml I usually launch the yaml files with ansible-playbook as I can do with one.yaml and ...
Robert Siemer's user avatar
0 votes
1 answer
2k views

In RHEL 9, SSH root login is not permitted. How do I set up managed nodes with Ansible? [closed]

I recently passed the RHCSA exam (RHEL 9). And I have started studying for RHCE EX294 with non-Red Hat affiliated materials. All of them are based on RHEL 8. In RHEL 8, the default sshd configurartion ...
Nameadd's user avatar
  • 41
0 votes
1 answer
799 views

Ansible Tower 3.8.6 installation fails on RHEL 9.1, with error: couldn't resolve module/action 'ini_file'

I tried to install ansible tower on a VM, obtaining the setup from the official RH repo: https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz Everything is from the ...
Somenath Sinha's user avatar
2 votes
2 answers
3k views

Turn off 'gather_facts' from 'ansible.cfg' or inventory file

Is there a way to turn off gather_facts other than at a play level? If I wanted to disable it permanently, is there a way to do it in the ansible.cfg or inventory file?
ImACarrot's user avatar
0 votes
1 answer
82 views

Automated Ubuntu Desktop Build - DNS Failure on boot

I am trying to create an automated build of an Ubuntu Desktop 22.04.2 using the official guide (https://github.com/canonical/autoinstall-desktop) and then use ansible to configure it. The automated ...
Samcro1967's user avatar
1 vote
1 answer
2k views

ansible comparing all files in 2 directories and printing the difference

I have 2 directories $ tree dir{1..2} dir1 ├── file1 └── file2 dir2 ├── file1 └── file2 I want to compare all files in dir1 with all files in dir2 using ansible and print differences like this output:...
Sollosa's user avatar
  • 1,951
0 votes
1 answer
459 views

Ansible failed to install (docker-latest docker docker-python python-docker-py)

I am trying to run the following playbook . . . tasks: - name: Install python and build dependencies yum: pkg={{ item }} state=installed with_items: - docker-latest ...
Salem Masoud's user avatar
0 votes
0 answers
106 views

What should the permission for .git folder look like? error: cannot open .git/FETCH_HEAD: Permission denied

I cloned repo to reproduce some examples with Ansible when I go for ansible-playbook install_dependencies.yml I am having error TASK [fetch k3s ansible role from github] ******************************...
Richard Rublev's user avatar
0 votes
1 answer
12k views

How to extract stdout of command as variable in ansible playbook

I am trying to install docker credential store with pass on a VM using Ansible here is the part of the credential store's code in the playbook.yaml However, the problem is I try to export the gpg key ...
devlooper's user avatar
1 vote
1 answer
1k views

Ansible: How to update array key value matching another directory key

I have the following dictionaries: question: first_run: app: - answer: null name: first_name question: What is your First name? - answer: null name: last_name ...
Rafal Niznik's user avatar
1 vote
0 answers
1k views

How best to create, manage, and delete systemd units with Ansible?

Several of our Ansible playbooks and rules install scripts that need to be run regularly, either on a schedule or triggered by changes to files. We can use systemd units for this purpose. We can write ...
reinierpost's user avatar
6 votes
3 answers
2k views

Ansible: Add user in sshd_config

A new employee has joined and I need to allow him to access test servers. Normally I use template and upload this template on servers depending on the type of environment. But this time I want to use ...
OmiPenguin's user avatar
  • 4,328
2 votes
2 answers
547 views

Panic/reboot multiple servers simultaneously via Ansible

I want to panic/reboot multiple servers at the same time via Ansible CLI, however, the command below gets stuck at execution. Could someone advise how to revise the command to achieve the concurrent ...
wang larry's user avatar
1 vote
1 answer
134 views

Ansible: gocryptfs doesn't ask for password

When I use Ansible to create all kinds of remote mounts that need a SSH password, the ansible-playbook command simply asks for them when I run it. However, when I want to create a gocryptfs mount, I ...
Krateng's user avatar
  • 163
1 vote
1 answer
422 views

ansible select from dict

need select from dict variables - name: test hosts: localhost vars: bum: 0 alpha: - 0 beta: - 0 - 1 test_vars: '{% if bum == 1 %}{{ alpha }}{% ...
tuytuy20's user avatar
1 vote
0 answers
501 views

I can run playbook on user but not on crontab

Hey everybody as i said in title i can run my playbooks in ansible but not in crontab, doesn't reach the machine, i entered correctly the ssh key, and become a ssh agent, i'll show you my code and my ...
Tux Over9000's user avatar
2 votes
1 answer
39 views

ansible mysqldb not accepting item in tagrget options

I have a db host, on which some sql files are present. I want to source it into db using an ansible playbook. so I find all files & register in variable, then try to source those using below code. ...
Sollosa's user avatar
  • 1,951
0 votes
1 answer
372 views

replace set_fact to vars in ansible role

Have this ansible playbook. Need change it for role without facts. How can I rewrite this code for variables using in role/default/main.yml Thank you --- - name: test my group hosts: my-group ...
tuytuy20's user avatar

1
2 3 4 5
10