Questions tagged [ansible-playbook]

Ansible playbooks are how ansible code is shared and reused.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
7k views

ansible: sum over fact array

I want to get disk sizes of multiple disks and sum them to check if the sum of their sizes is greater than the minimum required. We are going to use LVM to create mountpoints, we need to be able to ...
vijay rajah's user avatar
30 votes
7 answers
89k views

Ansible: How to run one Task Host by Host?

On the play-level, we have serial: 1 to allow us to run the whole play one host at a time. But I haven't found a simple way to do this on a single task. This is especially relevant, if the task in ...
Elrond's user avatar
  • 596
19 votes
1 answer
49k views

In ansible, how do I specify an exclusion set of hosts in a playbook?

With command line patterns, you can specify patterns like "all,!ntpservers" but I can't figure out how to specify this in a playbook. I'm regularly running into cases where I have to install a client ...
Robert Rapplean's user avatar
17 votes
1 answer
16k views

Why is ansible notify not working?

I'm learning ansible and wrote simple playbook, but I don't understand or what I'm doing wrong that handler not working! Please, help me. My playbook: - hosts: HA gather_facts: False tasks: -...
amkgi's user avatar
  • 323
11 votes
1 answer
61k views

Converting string to integer in Ansible Playbook

I am getting a count from powershell command and registering it on variable. I have to use that count in when condition. I have changed it to int before using it in when condition too. Still that task ...
saffron's user avatar
  • 153
8 votes
4 answers
17k views

How to do mysql_secure_installation via ansible playbook?

I managed to install Apache Mysql/Mariadb and PHP using playbook. How can I do mysql_secure_installation using ansible? I am a beginner in Ansible. I want to set a new password to MySQL server and ...
Prince Joseph's user avatar
7 votes
1 answer
11k views

Ansible same host on different groups with group_vars

I have an Ansible inventory like the following: [group1] host1.mydomain [maingroup:children] group1 [group2] host1.mydomain I need to declare the same host on different groups since in this host ...
trikelef's user avatar
  • 528
1 vote
1 answer
395 views

Need to know more about the handlers in ansible

Below is the tasks I have in my nginx role # tasks file for nginx - name: Backup and update nginx configuration file template: src: templates/proxy.conf.j2 dest: "{{ nginx_conf }}&...
Vicky Ingle - Mint's user avatar
1 vote
1 answer
2k views

How can I log inventory_hostname to a file on the remote using a Playbook?

I'm trying to write the inventory hostname to a remote file for later processing (eventually a remote fact file). The host below has the physical hostname calvin.mydomain however the controller ...
Server Fault's user avatar
  • 3,784
0 votes
1 answer
319 views

Ansible - jenkins plugin failing on Google Container Engine (GKE) - infinite loop with ingress

I have such config for ansible: - hosts: localhost connection: local tasks: - name: Jenkins - add job jenkins_job: config: "{{ lookup('file', '...
user3069488's user avatar