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
1 answer
22 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
  • 519
0 votes
1 answer
25 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
0 answers
10 views

AWX on Kubernetes - How to make it accessible on localhost

Let me start off by saying that I know nothing about Kuburnetes. I am installing AWX in a minikube cluster and need to access awx on the localhost. For some reason (and again have 5 hrs of experience) ...
ImACarrot's user avatar
0 votes
1 answer
32 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
0 votes
0 answers
69 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
22 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,889
0 votes
1 answer
46 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,889
0 votes
0 answers
36 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
  • 519
0 votes
2 answers
78 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
370 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
294 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
0 votes
2 answers
666 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
50 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
570 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,889
0 votes
0 answers
52 views

How to handing pop up pinentry question with ansible playbook?

I am using the Ansible playbook to make a VM template with the docker credential store installed. However, there is a problem with the step of init the pass store, my step is similar to the step of ...
devlooper's user avatar
0 votes
1 answer
187 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
54 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
3k 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
427 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
0 votes
0 answers
330 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
5 votes
3 answers
841 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,178
1 vote
2 answers
188 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
74 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
  • 143
1 vote
1 answer
249 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
258 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
36 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,889
0 votes
1 answer
238 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
0 votes
1 answer
117 views

Why Ansible failed to ping instance which I can connect?

I can connect my AWS EC2 instance ssh -i "pizdform.pem" [email protected] Last login: Tue Feb 21 12:36:50 2023 from ... I tried Ansible ping cat test-project/...
Richard Rublev's user avatar
0 votes
2 answers
253 views

ansible copy ssh keys to multiple users' home directory

I have ssh keypair on my ansible_host, which I want to copy to multiple user's authorized keys on target host. I'm trying with-item construct, but it complaints about .pub key not an invalid key here'...
Sollosa's user avatar
  • 1,889
1 vote
1 answer
81 views

docker logs err:"+ sudo -E kolla_set_configs sudo: unknown uid 42401: who are you?" in openstack container

Multinodes(3 nodes) openstack cluster deploy by kolla-ansible, two nodes(2nd and 3rd nodes) are working well, the one node(1st_node) have some containers always Restarting with the error logs, e.g. ...
VictorLee's user avatar
  • 115
2 votes
2 answers
665 views

Ansible - fetch files from one remote node to another

I'd like to use Ansible to upload files from local workstations to a NAS server. Both are managed via Ansible. The only way I've gotten this to work so far is by mounting the NAS file share as a local ...
dkd6's user avatar
  • 77
1 vote
1 answer
137 views

Awk command with &&

What I am trying to do is to use the awk with Ansible so that I can get the hostname and the vlume that are greater than 50% I then can run the following to get the volume that has more than 50% ...
goced's user avatar
  • 13
1 vote
0 answers
22 views

In Ansible, using azure_rm, is there a way to assign a host to multiple groups using a single key value and a separator?

Using the following sample azure_rm inventory file, is it possible to use a single Azure VM tag to assign a host to multiple groups dynamically? For example, if the Azure tag is type="vmtype1,...
Ansible's user avatar
  • 11
0 votes
1 answer
255 views

Ansible: Firewalld how to set multiple services (loop from another playbook)

I see the issue when I try to set multiple services to the zone. Only first one is set and another always comes with the following error: TASK [Set services] ******************************************...
Rafal Niznik's user avatar
1 vote
0 answers
36 views

how can I feed the hash value from digest.rdf to ansible get_url?

For example here we have a list of digests. I wonder is there simple way to generate a checksum value for get_url out of it. Is there any easy way to parse rdf into dictionary? or maybe we can query ...
Wang's user avatar
  • 1,214
1 vote
0 answers
68 views

Ansible: preparing for the release of a new distro version

as a debian user I'm looking forward to the new Bookworm release, presumable this summer, but this question is relevant for all (non-rolling release) distro's. I have developed a set of roles for my ...
zenlord's user avatar
  • 688
0 votes
1 answer
543 views

adding ansible_python_interpreter to task with expect module fails to get command with become_user

I'm writing a task for CentOS7 inventory in which have to go through prompt dialogues, which I think is best candidate for andible's expect module. - name: setup some command become: yes ...
Sollosa's user avatar
  • 1,889
1 vote
0 answers
34 views

How do I pre-configure SSH key on a new workstation?

I want to manage installs and updates on a park of Ubuntu nodes using Ansible. What is the issue ? If I want to connect to other nodes using Ansible, I need SSH access to them. Which means I need to ...
Mr. Folder's user avatar
1 vote
1 answer
647 views

Adding host to Zabbix 6.2 through ansible failed (worked on 6.0)

I have an issue with the conversion (migration) from zabbix 6.0 to zabbix 6.2. I have a playbook in Ansible to automatically add a host to zabbix with some host_groups and Templates predefined which ...
SHLelieveld's user avatar
0 votes
0 answers
116 views

Sudoers settings for ansible user

I have made a playbook which does something like this: shell: source ~/.bashrc && some_command |awk something more become: yes become user: a_user become_method: sudo My Ansible_user that ...
just_a_noob's user avatar
5 votes
1 answer
212 views

Is it possible to specify hosts for an Ansible role based on a map value?

I have hosts, where I can setup application on a single node architecture or distributed. So I have an inventory. [STG] node1 [LIVE] app_node db_node gateway_node So a variable with default value be ...
Sollosa's user avatar
  • 1,889
2 votes
1 answer
46 views

How to add conditional force to the command in ansible playbook?

I want to copy the file forcedly only for projectA item from below playbook. - name: Populate /usr/local/mywork/ binaries where necessary copy: src: "output/here/usr/local/mywork/{{item}}&...
Hardguy's user avatar
  • 49
0 votes
0 answers
245 views

ansible | Proceed to the next task once the host is unreachable

I am performing code upgrade to a host and it is expected that it will reload, I want to apply the upgrade command and it is expected the host will reload and be offline for some time, once its up ...
Somayyah Mohammed's user avatar
1 vote
1 answer
506 views

perform ansible task if string doesn't exist in a multiline register

I want to push configuration for network devices only when that configuration is missing, by searching for a string in the registry output, first I run this task to record the running config on the ...
Somayyah Mohammed's user avatar
1 vote
1 answer
1k views

Ansible to the fetch the value from stdout and fail if the variable is more than the threshold defined

Would there be any way to retrieve only the value of row_count from STDOUT and ansible playbook to then fail if the row_count is more than 10? (row_count > 10) STDOUT: temp_id,order_id,status,...
anandkrish0501's user avatar
0 votes
0 answers
30 views

Implementing the right conditions for a yum command for centos5 in Ansible

I'm currently working with a centos5 host and I have to install some packages with yum.. unfortunately, as far as I know, centos5 doesn't support Ansible's yum module so I have to use the 'command' or ...
Wander's user avatar
  • 1
0 votes
0 answers
19 views

The creation of a new user via user Ansible freezes indefinitely

I have Ansible playbook that I received from a previous employee. This playbook should create a user and copy the public login key from the local machine. But for some reason, the creation of a user ...
HtmlMan's user avatar
2 votes
1 answer
132 views

Ansible conditional

My goal is to find a way to combine the two statements below but am coming up short. For this instance, I have Package1 and Package2 that are being installed regardless of rhel version. However, ...
ImACarrot's user avatar
0 votes
0 answers
103 views

Ansible Parallel and pre-conditoons

I have a strategy question regarding parallel execution of ansible-playbook on the same machine. So we have 3 parallel runs on the same playbook triggered by Jenkins jobs. Example: ansible-playbook -i ...
Alfador's user avatar
2 votes
1 answer
222 views

ansible telnet isn't working

I am trying to use the telnet command with ansible expect module to push initial configuration but it's not working, I am suspecting the issue is with the responses section, here is my playbook: - ...
Somayyah Mohammed's user avatar

1
2 3 4 5
10