Questions tagged [ansible-playbook]
468 questions
0
votes
1 answer
Multiple containers in host over Ansible
Am wrote a playbook to create a container within a host machine. my idea is to create multiple containers per hosts. am trying to use the host.ini file to divide the host machines as a group and each container as an Ansible host within the group. Do…

Saptronic
- 13
- 1
- 4
0
votes
2 answers
Execute a task from a host in a role and delegate other task to other host in other role
Context:
I have a project with two roles.
I've reduced the number of tasks to the problem ones for better understanding.
Problem:
I run a task from a role1 in server1 and trie to delegate a task to a vmware virtualizer from condition in the first…

azk
- 39
- 9
0
votes
2 answers
Ansible task output to a file in ansible server
I'm writing a playbook that will check the application version on different hosts and write the output to a Ansible variable.
My requirement is I want to output the ansible variable to a file output.log.
What the problem is the variable is written…

Manikandan Ram
- 399
- 2
- 15
0
votes
1 answer
Apply Security patches using zypper module
Do we have any options to apply security patches only with Zypper ansible module for suse linux server. We don't want to use shell or command module and incorporate the command.
Equivalent command shell: zypper patch --category=security

pugazhendhi
- 27
- 1
- 3
0
votes
1 answer
Forward local ssh key to remote host
I'm using ansible and i'm wondering. Is it possible to rewrite a local ssh key to a remote machine? I need to clone a repository using my private key on a remote machine. I cannot add the key from the machine in this case )this key will vary…

onev
- 1
- 1
0
votes
0 answers
Ansible: extracting a string between two strings
So I have an html file that contains the following somewhere in the middle:
http:(...).com
I'm attempting to extract the url, but am having some issues doing so. Because that "ltr" is the only one that exists in the html, I…

Ress
- 45
- 1
- 2
- 8
0
votes
1 answer
loading additional modules with ansible tower
I'm trying to run a playbook on ansible tower but I'm having issues loading extra modules. I checked the playbook is configured right but it still fails with the message below...
[WARNING]: Invalid characters were found in group names but not…

mitchell2423
- 25
- 5
0
votes
1 answer
allowing user to run playbook without giving them password
I have an ansible playbook that I would like to allow a regular user to run to install an application on a centos server, but I don't necessarily want to give them the login credentials. I know you can use ansible vault to store encrypted data, but…

jldiets
- 1
- 1
0
votes
0 answers
Ansible conditional file placement
How do I perform the following with Ansible playbook. I'm new to it. Thanks!
File example that contains the hostname and password
{
"hosts":[
{
"node": "node1",
"pass": "pass1"
},
{
"node": "node2",
"pass": "pass2"
…

user772543
- 1
- 1
0
votes
1 answer
In ansible playbook, how skip task if file already exist in block task?
I have a task like this :
- name: install jetbrains toolbox
changed_when:
block:
- name: download toolbox
get_url:
url: 'https://download.jetbrains.com/toolbox/jetbrains-toolbox-{{ toolbox_version }}.tar.gz'
dest:…

Pierre-Antoine Guillaume
- 200
- 2
- 7
0
votes
1 answer
Ansible regex didn't match command output - Empty list -
I'am trying to get the list of the device ID and the list of the port Id with ansible with regex but i get an empty list, below the output that i'am trying to parse it :
Device ID Local Intrfce Holdtme Capability Platform Port…

user713502
- 1
- 2
0
votes
1 answer
deploying on hosts with ansible based on yaml file
Developers are going to provide a yaml file with hosts in particular order (every deployment can differ, depend on needs) and each field in yaml file will have instructions for example install yum packages. I'm going to take this information and run…

Dark Furby
- 11
0
votes
0 answers
Ansible exclude semicolon
I'm new to ansible and right now I'm trying to search a specific word from my output:
vars:
vlans:
- vlan 999
tasks:
- name: Check Vlans
ios_facts:
gather_subset:
- '!all'
gather_network_resources:
-…

Heiko
- 1
0
votes
1 answer
Ansible: Iteration fails while looping over output variable
Here is my debug output from an ansible playbook:
"msg": {
"changed": false,
"failed": false,
"instances": [
{
.........
"private_dns_name": "ip-10-XXX-XXX-XX.ec2.internal",
…

Alfred Hitchkock
- 101
- 1
0
votes
1 answer
How to fetch the disk difference before and after adding a new disk
I'm preparing a playbook to find the newly scanned HDD from vmware, I used below filtering to fetch the no. of HDDs:
before_add: "{{ hostvars[inventory_hostname].ansible_devices.keys() | select('string') | list }}"
OUTPUT- ['sr0', 'sda', 'sdb',…

pugazhendhi
- 27
- 1
- 3