Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ansible]

Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management.

0
votes
1answer
19 views

set date on the mail body via ansible

I am trying to send a mail via ansible yaml that looks similar as below. The requirement is to send this email a week ahead of the patching. I can schedule it in cron, but I need to send an email 1 ...
0
votes
1answer
40 views

Haproxy healthcheck and backend section generation

I have a lot of sites and I want to do a http healthcheck for each one. Does it mean that I need to make a backend section for each site? If so, I need to generate it somehow. Can I achieve it with ...
0
votes
1answer
29 views

lineinfile module creating a file if it doesn't exist even I use “create=no”

--- - hosts: testhost become: yes tasks: - name: change user profile copy: src=/tmp/profile dest=/home/test/.bash_profile force=no owner=test group=test - name: update bashrc ...
0
votes
1answer
17 views

Ansible cloud stack module nested loop for security groups and ports

I'm trying to set multiple security groups at once using the ansible cloud stack module. The yaml file currently looks like this: - name: add inbound tcp rules to security group web ...
0
votes
0answers
15 views

Why is Terraform prompting for a variable value when I've already declared it?

Background In regards to ansible-playbook plays. I'm aware you can output to a log: log_path = ./ansible.log I'm aware of adding verbosity (-v, -vv, -vvv...) to the output. However what about ...
0
votes
1answer
22 views

NFS Migration automation (CentOS 5)

I need a little help with an upcoming migration. The storage team has implemented a new netapp stack. Once I have a tested script, I have around 400 servers across two environments that I'll need to ...
0
votes
2answers
42 views

How can I abstract away Ansible roles?

I have 2 different database instances in my infrastructure, each used to save different data, each running on different machines, and each of them needs different levels of availability & safety, ...
-1
votes
1answer
45 views

Openshift installation playbook failing

I'm trying to install 2-node cluster with origin version 3.10 (one master, one node). Playbook fails on task openshift_control_plane : Wait for control plane pods to appear Initialization ...
2
votes
1answer
98 views

Ansible Playbook running locally but unable to ssh to host via AWX

SUMMARY I have ansible and ansible AWX installed on same AWS EC2 instance and I am trying to deploy build on another app AWS EC2 instance. I am able to run the playbook via ansible-playbook command,...
1
vote
0answers
17 views

Using Ansible ini_file with nested dict?

What I am trying to achieve is the following. Suppose we have a playbook similar to the following one: --- - hosts: local tasks: - ini_file: path: test.ini create: yes ...
0
votes
1answer
30 views

Ansible & Terraform DNS creation on Active Directory with nsupdate

I'm trying to create a new DNS record on active directory with the nsupdate module. Both, Terraform and ansible works with key_name & key_secret. If I disable the secure only option on active ...
0
votes
2answers
23 views

ansible replace module is not working as expected

my ansible play book is working for me to uncomment certain lines in a .conf file, but its failing for one particular line its not making any change. below is my .conf file part. #<VirtualHost ...
2
votes
1answer
25 views

ansible -how to pickup hostname and create self signed certificate

i have working command for creating self signed certificate for IHS server's .kdb file and i was trying to use the same command through ansible. Here my aim is that ansible should detect the hostname ...
0
votes
1answer
22 views

Where do I put group_vars in an ansible setup and galaxy role

I'm trying to use my first playbook with a galaxy role and while I can get the role to run, I can't seem to get it to find the group_vars I've defined. The role is nickjj.mariadb (not that that ...
1
vote
1answer
50 views

How can I set an Ansible variable depending on hostname?

If I run ansible-playbook playbooks/snapshot.yml -l my.host.net I want to reference a VMID variable which is pre-set to this hosts virtual machine ID (4321 for instance). I've found a question that ...
0
votes
1answer
33 views

How to filter the content of Powershell script output?

I need to capture the result of MSSQL Queries in Ansible output however, there are no supported Ansible modules which help me to achieve this. As a workaround, i have written a powershell script which ...
0
votes
1answer
18 views

Jenkins Ansible: How to get Ansible resources to slaves

we plan to use jenkins and ansible to manage our environment: one jenkins master and a number of jenkins slaves. The slaves have ansible deployt. The ansible playbooks and roles are generated from a ...
0
votes
0answers
28 views

Avoiding jinja templating delimiter in when statements

I'm currently porting my Ansible playbooks from version 2.1 to 2.7. Ansible now prints a warning if I use jinja templating delmiters such as {{ .. }} in a when clause. [WARNING]: when statements ...
0
votes
1answer
69 views

Ansible expect is not sending response

I'm new to ansible and trying it by writing an ansible playbook for installing graphite, as a part of it I have the graphite-manage syncdb command which I would like to automate. I wrote this task to ...
1
vote
2answers
52 views

How to properly automate git push to server

I am in the process of migrating our ansible files to our internal gitlab server and have some confusion about the various ways to keep the ansible roles directory in sync with the gitlab project. The ...
0
votes
1answer
19 views

Unable to access group address for template in Ansible

I'm trying to enumerate my eth0 address (set to default, because I read somewhere that eth0 is not always available..). In my template I attempt calling it from the group like so... [Unit] ...
0
votes
0answers
10 views

using external ansible node as awx instance

I'd like to use AWX as a management interface but use my other Ansible Linux boxes to execute the jobs. I thought I could add them as an instance into AWX but that only appears to be an option if I ...
0
votes
1answer
28 views

Ansible Playbook and syntax issue with variables

I'm trying to execute the below playbook I wrote but it fails on some syntax errors. I tried few things from the online doc but without sucess so far. The aim of these variable is to generate a ...
1
vote
2answers
70 views

Ansible: iterating over a nested dictionary?

I have data that looks like this: nova_flavors: - disk: 10 name: m1.tiny properties: disk_read_bytes_sec: 12500000 disk_read_iops_sec: 1000 disk_write_bytes_sec: 3125000 ...
3
votes
1answer
64 views

Ansible fails at “Gathering hosts” presumably because SSH is slow to connect. Setting `UseDNS no` resolves the issue

I am having what appears to be a DNS related issue that I would appreciate some assistance resolving. I'm using Ansible to provision a Kubernetes cluster on my Proxmox server. The project works in ...
1
vote
1answer
44 views

wordpress api unique keys/salts not properly inserted with lineinfile and uri module in ansible

This is what I'm using to insert the text in wp-config: - name: insert unique key and salts in wp-config lineinfile: path: /var/www/wordpress/wp-config.php regex: "put your unique phrase ...
0
votes
1answer
19 views

ansible: insert content of wordpress unique keys and salt into variable

in handlers/main.yml I've got: - name: get API information for wp-config uri: url: "https://api.wordpress.org/secret-key/1.1/salt/" return_contents: yes register: ...
0
votes
1answer
39 views

Overriding ansible_skip_tags within a playbook

I’ve been able to manage Ansible's control variable that you usually specify on the command line using the set_fact module; such as - name: Use a default SSH key for this playbook set_fact: ...
0
votes
2answers
60 views

Ansible: user escalation failure

I am having a hard time understanding how to set privileges per task in ansible. So given the playbook scrappy, I want to log in as the admin user (ubuntu) but do something as the user scrappy. Note ...
1
vote
2answers
114 views

Ansible Variable above hosts

Ansible Variable above hosts hello its posible to create a variable for multi hosts like this? vars: some_vars: "./Prometheus/roles/" # <---- THIS Variable? - hosts: lxd1 vars_files: ...
1
vote
3answers
258 views

Rollback the changes in Ansible

Is there any method to rollback the changes in Ansible? Suppose my play book contains different plays like create 5 users,install 3 rpms, start the services. If I want to rollback a certain play how ...
0
votes
0answers
49 views

Get “gs_secret_key” and “gs_access_key” values for Google Bucket

I need to create a directory in a Google Cloud Bucket using Ansible. I would like to know where I can find the values to complete "gs_secret_key" and "gs_access_key" to use "gc_storage" module in ...
-1
votes
1answer
75 views

Change user as root in Ansible

We have a requirement to install Siebel application using Ansible. We are trying to install Oracle Client with Siebel user which we did successfully. Now next step we want to run one custom shell ...
0
votes
1answer
81 views

ansible find and change permissions

I am scratching my head to why my code is not registering files in the dict something wrong with my code in the playbook but cannot see what vars: file_vars: - { spath: /var/log/ctm, type:...
0
votes
1answer
49 views

AWS credentials not being picked up by AWX template

I've got a new Ansible AWX server running and one of the things I'd like to do with it is to create an AMI of AWS instances before then installing regular updates to the instances. I've got the ...
-1
votes
1answer
50 views

Test ansible role on localhost

How can you test(-run) an ansible role on your localhost? So far I have done this on my ubuntu 16.04 machine: $ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo apt-add-...
0
votes
1answer
148 views

Register var with dict and loop over output dynamically

I want to create and boostrap multiple vm's with an ip. This is working when only creating one at a time, but I would like scale this playbook to create more than one at a time. I make a call to ...
1
vote
1answer
72 views

Ansible: Pass a variable gererated in a role af a host1 to another role of a host2

I am trying to use a variable generated in a role for a host1 and use it in another role for a host2. This is the general layout used: | # Group variables +-- group_vars | +-- all # variables ...
1
vote
0answers
20 views

Setting a mountpoint as immutable with ansible makes the mounted volume unable to be written, while it works manually

As a force of habit after losing several hundred TB of data in the past during a NAS outage, I always set mountpoints on servers to be immutable. It prevents any changes to the disk structure ...
0
votes
2answers
84 views

Ansible - wrong passphrase - even if it has to be correct

i am running ansible modules/playbooks (for example ping) with this command by user, who have sudo rights: sudo ansible -m ping hosts "hosts" is group of 2 hosts. When i run this, i'm asked for ...
0
votes
1answer
38 views

Jenkins API intermittent authentication errors

I'm using Ansible's jenkins_job task to set up some Jenkins jobs. I'm authenticating with a username+password which is authenticated as a Linux user on the Jenkins machine. - name: Install my job ...
0
votes
1answer
40 views

Ansible - manage installed apps and send output via email - variables are filling wrong

so i have this playbook, which checking, if there are installed selected packages. nothing special there. Then i would like to send an output to my email, if everything went right etc. --- - name: ...
0
votes
1answer
29 views

How to define Microsoft network client: Digitally sign communication (always) with ansible win_regedit

I want to select Define this policy setting for Microsoft network client: Digitally sign communication (always) in the Group Policy on Windows Server with Ansible and select Disabled radio button. The ...
0
votes
1answer
60 views

Ansible: run additional tasks for specific inventory

As per the "Best Practices" chapter in Ansible's documentation, I have separate inventory files for my development and production environments. While both environments get the same software stack ...
1
vote
1answer
85 views

Ansible - Using different users to login when working on a dynamic inventory

I'm trying to install a package on a list of servers, these have a tag in common so I'm using that tag as they are all having Environment tag set to Dev. But the issue is some of them have OS as ...
4
votes
1answer
207 views

What does Ansible push to the remote host?

Wondering how Ansible works at a brick level. Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python. It seems like Ansible would need to ...
-1
votes
2answers
128 views

Creating users via Ansible and with_subelements

I'm trying to write an Ansible playbook which will allow me to define a list of groups to apply to a list of users, across a list of defined servers. It seems to be getting close to working except ...
2
votes
0answers
60 views

Explanation needed on what situations make a task run on two hosts in the same try?

I came across a task that seems to be trying to run on two hosts like so: TASK [setup] ******************************************************************* fatal: [====]: UNREACHABLE! => {"changed":...
0
votes
1answer
75 views

Force Ansible to log off to refresh user groups

I'm setting up a server with Ansible and Docker. I'm currently learning both technologies, so please bear with me if I'm being overly stupid here. In order to run run Docker commands, the user has to ...
2
votes
0answers
125 views

How Do I Use Ansible Tower's Credential Parameters (Machine, Network, Cloud) in my Playbook or inventory file

I am using AWX (open source Ansible Tower) and I have 2 cloud based linux machines I would like to manage with it. The 2 Linux machines have 2 different private keys that I have uploaded to the ...