Questions tagged [ansible-playbook]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

creating user and sshkey with ansible user module

I wanna create some local and remote users and generate ssh keypair for respective users and transfer them to remote server but it seems local user - ansible - which runs ansible-playbook does not ...
0
votes
1answer
22 views

Failing play prevents later 'localhost' play from executing

I've written the following playbook. I expect an error from the second play, but the first and third to run. What I get is the first running, the second failing, and the third is completely ignored. ...
0
votes
2answers
33 views

Check if job is running on another server in the same network using Ansible

On a private Network, I have two servers, let's call them server01 and server02. They are in the same network. The second server is rebound server i-e if server01 is no longer active, the second ...
0
votes
1answer
21 views

How access ansible dictionary ansible_net_interfaces sub branches

I'm trying to read information from ansible_net_interfaces, but the interface names will be different on each device. I'm having no trouble accessing most information, but when I get to ipv4, there's ...
1
vote
1answer
90 views

Ansible - Avoid duplicates between group and host vars

I'm new at using ansible for server management and I need some help managing users and group's membership definition according to host and hosts-group, with a minimum of duplication and a maximum of ...
1
vote
0answers
22 views

How to convert and save raw data to PDF format using ansible

I will be getting some raw data directly from an API. I want to format this and convert into PDF file and save it. I gone through ansible modules. I am not getting any idea in this. Can someone ...
0
votes
1answer
51 views

How to merge two files into single file using ansible in remote server

I need to merge two files without duplicate entries in it. is there any way i can achieve it through ansible modules. Ex i have two files /etc/hosts1 and /etc/hosts2. I need to have one /etc/hosts ...
1
vote
1answer
42 views

Extracting part of the string using Ansible regex_search and save the output as a variable

I'm having a content like below inside a file. dataDir=/var/lib/zookeeper 4lw.commands.whitelist=mntr,conf,ruok,stat syncLimit=2 I wanted to read the value for dataDir using Ansible and set it to a ...
0
votes
0answers
24 views

Ansible file module not deleting files for dictionary

My program basically keeps the latest three backups and deletes the rest of them. When I check it is not deleting the files. Below is my code. No error was generated. When i check the server the file ...
0
votes
1answer
61 views

How to rename a file using ansible

I need to rename hosts_example or hosts_Example to be named as hosts_real if any of the file exists - name: Playbook to Standardize Hosts hosts: test vars: destpath: /etc/hosts_real ...
0
votes
0answers
21 views

User is not allowed to execute command as another user

--- - hosts: all become: true become_user: root become_method: sudo gather_facts: False tasks: - name: Root user check shell : export PATH=$HOME/python/Python-2.7.12:$...
2
votes
1answer
250 views

Ansible on IOS to loop through subset of interfaces

Running WISL on Windows 10 and Ubuntu with ansible 2.9.9. I am new to Ansible. I execute a show on a Cisco device to yield the interfaces on which a given network protocol runs. I then want to extract ...
0
votes
0answers
18 views

ansible:manipulating 200 files quick

I have a tomcat server with 200 instances. I have created a playbook for deploying a new server and it works fine, BUT I have several plays that manipulate numerous files in each tomcat-instance, and ...
0
votes
1answer
39 views

Ansible source of variables

I have a playbook like: - hosts: GROUP1 remote_user: ubuntu become: true gather_facts: False roles: - role: role1 - role: role2 The in group_var GROUP1 has php7 packages GROUP2 has php5 ...
1
vote
2answers
86 views

ansible-playbook --limit more than one host?

For various reasons/limitations I cannot make new groups in the inventory file and need to use --limit/-l to specify the hosts. I was told to do something like: ansible-playbook -i /path/to/my/...

15 30 50 per page
1
2 3 4 5
20