Questions tagged [ansible-playbook]
468 questions
0
votes
1 answer
How to create a local fact in Ansible playbook which will skip steps which are already done in previous runs?
I wrote a playbook which clones from git three repo's and compiling them from source.
Whenever I provision a machine which uses this playbook, the repos are cloned, no matter if the local copy of the repo is already updated.
I'd like the git clone…

Itai Ganot
- 10,644
- 29
- 93
- 146
0
votes
1 answer
Ansible playbook with 'async' outputs out of order when executing on multiple servers
I have a playbook that is suppose to run a script on 5-10 servers in parallel
- name: Run script & cleanup
ansible.builtin.shell: |
...
bash {{ SCRIPT }}
...
args:
executable: /bin/bash
async: 1800
poll: 60
I have to add…

Subzero123
- 49
- 1
- 6
0
votes
1 answer
script file is not getting executed on target machine using ansible script module
script file is not getting executed on target machine using ansible script module.
I have written a script file on control-node wants that to copy it on target machine and then from there i wants to run the script file using ansible script…

Priyanka
- 1
0
votes
1 answer
Ansible regular expression to match a string from a list of line
I'm trying to read a content of file from remote file. but i want the message to be displayed only matched UUID from fstab file. but when i ran below playbook it is throwing below error.
playbook:
- name: read content from a file
hosts: all
…

Priyanka
- 1
0
votes
0 answers
Trigger a Ansible-Playbook when i create a VM in Netbox
Is it possible when i create a Virtual Machine in Netbox that can trigger an Ansible-Playbok what add stuff? for example Create the VM in CheckMK with the details whats written in Netbox.
Thanks everybody for Answering.

Marvin Fratzke
- 1
- 1
0
votes
1 answer
Want to Use Ansible Lineinfile Module to Insert Private IP Addresses from Hosts in the zookeeperservers Inventory Group
I need to modify a line in a configuration file with the private IP addresses of the hosts in the zookeeperservers inventory group.
The config file is an .xml file.
The key word in the config file is "Connect String">.
There are 3 hosts in the…

David S
- 3
- 1
0
votes
1 answer
Ansible: ERROR! 'shell' is not a valid attribute for a Play
---
- name: Extract PS output.
shell: "ps -ef | grep pmon"
register: pmon
- name: Display PS output.
debug:
msg:
- "{{ pmon.stdout_lines }}"
Error:
ERROR! 'shell' is not a valid attribute for a Play
The error appears to be…

Learner
- 3
- 2
0
votes
1 answer
Ansible: [WARNING]: The input password appears not to have been hashed
I'm facing an issue while using Ansible 2.9.27 on RHEL 7 to automate my infrastructure, specifically when working with encrypted passwords in my tasks.
When utilizing the password option of the ansible.builtin.user module to provide an encrypted…

sebelk
- 682
- 4
- 13
- 32
0
votes
0 answers
How to import all projects defined in a metadata.yml file?
This is my first foray into anything AWX/Ansible, so please be gentle :)
I've set up a new AWX instance in Kubernetes (using the AWX Operator), and am trying to import our existing job-templates from an old instance (that I did not set up, nor have…

Sagar
- 534
- 3
- 7
- 21
0
votes
1 answer
How to force Ansible 'shell' task to change state with 'changed_when' condition?
I am running script with Ansible task which installs some repositories and my goal is to show changed state when running change mode to notify, that script will run if check mode will not be activated.
My first task is to check existence of this…

dorinand
- 319
- 2
- 5
0
votes
1 answer
Ansible: escaping special characters in a regexp loop
I been having problems getting this to work, can anyone provide any insights?
- name Configuring rsyslog.conf playbook
hosts: "{{host}}"
tasks:
- name: Configuring rsyslog.conf
lineinfile:
path:…

Gene
- 15
- 4
0
votes
1 answer
UNREACHABLE! => {"changed": false, "msg": "Data could not be sent to remote host
I have SSH access for a particular server, but when I am trying to run the playbook for that server. I am trying to do the deployment for that server but I'm facing an issue.
fatal: [lapp999.corp.com]]: UNREACHABLE! => {"changed": false, "msg":…

Varun K M
- 13
- 4
0
votes
1 answer
Setting mysql using ansible in ubuntu remote machine
I have written one ansible playbook for installing MySQL server in ubuntu remote machine but is not working here is the yaml code
---
- name: setting mysql in ubuntu
hosts: web01
become: yes
tasks:
- name: install mysql
apt:
…

Nikhil Chopra
- 3
- 2
0
votes
1 answer
You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable
My environment:
# cat /etc/debian_version
11.7
# ansible-playbook --version
ansible-playbook [core 2.13.1]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible…

alexus
- 13,112
- 32
- 117
- 174
0
votes
0 answers
Can't connect from Debian VM to Windows Server VM
I've got a problem while trying to configure my Ansible server to connect to a Windows host using ssh keys.
When I try this command :
ansible win -m win_ping
I never got an answer, even after few minutes. But, when I try to debug using -vvv, I don't…