Questions tagged [ansible]

Use this tag for questions about Ansible, an open-source automation engine, related to using Ansible for topics such as cloud provisioning, configuration management, application deployment, etc.

Filter by
Sorted by
Tagged with
-1
votes
0answers
6 views

open source tool to manage token and variable support YAML

Using Ansible to deploy spring boot micro-services application i found my self managing group vars and application tokens manually. Is there an open source tool in which you can manage variables and ...
0
votes
0answers
17 views

How tansfer double from jenkinsfile to remote target host via ansible ssh?

I have jenkins ansible and remote host jenkinsfile code def CONSUL_HCL_FILE_CONTEXT(name,port,target_host){ def CONTEXT=""" service { name = '${name}' port = ${port} enable_tag_override = false ...
0
votes
0answers
31 views

How to manage a fixed infrastructure?

I work for a company that serve software for gas stations, our job is to provide a software that manage all functionalities, including financial, vendors, attendants, prices, etc. For this we use ...
0
votes
1answer
15 views

ansible filter debug output

I have the following output resulted from a shell command which is run on ansible on every host from my inventory: TASK [debug] ok: [10.240.22.44] => { "msg": { "changed": true, ...
1
vote
1answer
27 views

Ansible temp dir change

Ansible version 2.9.2 Is it possible to change ansible temp dir for one playbook only? I have VMs with r/o root. So, the playbook fails. Even if I run my playbook under root user on target VM it can'...
1
vote
1answer
27 views

Ansible execute task on different hosts in order

Is it possible to use ansible to manage order of programs? Im trying to find an automated solution which will do the following steps: run a program on HostA run a command on HostB which requires ...
0
votes
1answer
22 views

How to manage images versions via docker-compose with Ansible

I planned to use docker-compose and a few scripts to manage the deployment of my app on staging and production. My idea was to use one docker-compose.yml with one .env file for each environment. In ...
0
votes
0answers
16 views

Automate AWS image import?

AWS needs VM images in the AMI format to be able to start them as EC2 instance. Currently I have an .ova image on my s3 repository which I would like to start as EC2 instance. Normally, one could use ...
1
vote
2answers
62 views

Ansible - Copy multiple files

I am trying to copy multiple files to the target like so: tasks: - name: "Copying files" copy: src: files/{{ item }} dest: /my/folder/ with_items: - file.txt The files ...
0
votes
2answers
41 views

Cannot install Ansible

So I am creating a packer template for docker with the image php:7.0-apache. I added a shell provisioner where I try to install ansible so I can provision the image: { "type": "shell", ...
1
vote
1answer
23 views

Ansible: Backing up variable value doesn't work as expected

Attempting to save a variable's value for backup before modifying it doesn't work. I have the following inventory file (note the custom ansible_port and user): all: hosts: test: ...
1
vote
1answer
19 views

Azure Powershell DSC or Ansible

I wanted to find out what are you using for Desired State Configuration on your end. I am thinking to start introducing Azure Powershell DSC or Ansible for DSC of our on-prem environment and cloud ...
2
votes
2answers
26 views

Ansible ad-hoc command to reboot servers in serial with a pause

How do I go through all hosts in an Ansible inventory in serial with an Ansible ad-hoc and reboot servers with a specified number of seconds in between each reboot? I am looking for something similar ...
1
vote
1answer
22 views

How to filter vmware_vm_facts

I'm trying to pull out the "uuid" from facts returned by ansible's vmware_vm_facts module. There is a solution to a similar question posted on Reddit, but when I try that, it fails with 'ansible....
2
votes
1answer
8 views

I'm trying to run `vagrant provision` on PowerShell Window for Ansible playbook

Here is what it replies: Windows is not officially supported for the Ansible Control Machine. Please check https://docs.ansible.com/intro_installation.html#control-machine-requirements What should I ...
0
votes
2answers
27 views

How to run Ansible command to update imunify360 settings

How can I use Ansible to run the following CloudLinux Imunify360 commands properly on CloudLinux 7 (similar to CentOS7)? I tried different ways to "escape" the colons in the commands and it doesn't ...
1
vote
0answers
24 views

Using SSH to open interactive session in ansible

Is there a semi-easy way to use Ansible to open an interactive session? I've spent a good long time making use of keys and other credentials stores to make a stellar ansible inventory file, problem ...
2
votes
2answers
130 views

Configure VPC for ECR access

I am creating my infrastructure with Ansible. I create a VPC and an ECS cluster where I use Fargate to run my docker containers. When the tasks are started I am prompted that the task was not able to ...
2
votes
0answers
31 views

How to test production Ansible execution without having to provision target

We use ansible for our day to day operation and so far so good. We have been looking for a way to run local test etc just like chef guys and found molecule that we use with testinfra/vagrant. While I ...
0
votes
0answers
39 views

Problem deploying Docker Container from ECR on EC2 with Ansible

So, This question is tightly related to my previous one, which turned out to be a consequence of a different issue. To ensure every confusion is cleared up, I decided it is better to make a new ...
3
votes
2answers
81 views

What is the most used tool for Cloud Infrastructure deployment Ansible vs Puppet vs Terraform?

I have some time for research at work right now, and I was thinking on expanding my knowledge on my favorite subject, which is DevOps (love you all). I have some advanced experience with Ansible, as ...
0
votes
1answer
17 views

Why Ansible skip items in inserafter?

I have about 10 hosts that I run a playbook for them with serial:1. in this playbook there is this code which append output of all commands in one file: - name: copy the output to a local file ...
1
vote
1answer
23 views

Why is Rails (with Nginx/Passenger via Ansible) unable to see my RAILS_MASTER_KEY environment variable?

I'm writing Ansible playbooks to provision an Ubuntu 18.04 server. I want to provision the server for a Rails application using Passenger and Nginx. I used geerlingguy.passenger from Ansible Galaxy ...
1
vote
2answers
37 views

Running Automation on Google Cloud Virtual Instances using Ansible

I'm trying to automate google cloud virtual instances remotely only using external ip addresses of virtual machines. I can ssh into the virtual machines using command line with user name ...
1
vote
1answer
20 views

ansible question to execute and display multiple commands

I have the simple ansible script below: - hosts: myhost tasks: - name: few commands command: "{{ item }}" with_items: - ls -l - df -h - cat /tmp/1 there ...
0
votes
2answers
148 views

Using `dig` Ansible module?

I am trying to look up the IPv4 address (a single one, which I will assert on!) for a given name using Ansible and use that as a fact "down the line". An MWE looks like this: --- # vim: set ...
2
votes
1answer
33 views

how to prevent Ansible from showing output on screen?

I have this in my playbook which execute a command on remote server and enters its log on local server. - name: run script shell: runuser -l testuser -c "/tmp/test.sh" register: myshell_output ...
0
votes
1answer
41 views

Ansible SSH best practices

What are the best practices to be followed wrt security when it comes to SSH authentication (password less, key based, etc.) when setting up Ansible in a new environment with 1000s of machines? Which ...
2
votes
1answer
45 views

Passing parameters from Jenkins to Ansible playbook

How can I pass parameters from Jenkins to my Ansible playbook? Eg. I want to take IP address from users and pass it to the playbook so that it will execute only on those machines.
1
vote
1answer
32 views

How to determine which packaged pip to install in order to run the Ansible pip module?

I am struggling to find a reasonable method to detect which of python-pip or python3-pip I should install depending on the contents of the ansible_python fact. This is on Debian and Ubuntu. Looking ...
0
votes
1answer
39 views

Running task or role before any playbooks

Is there a way to run a specific task or role at the very beginning of every ansible-playbook run? I'm looking for something that would go into ansible.cfg or something like that, so all playbooks ...
0
votes
1answer
49 views

Ansible can't recursively delete a directory

So, I am trying to recursively delete a directory with all files/folders inside. I tried: - name: Cleaning up file: state: absent path: /tmp/myfolder/ But the directory did not get ...
1
vote
0answers
16 views

Does CDK perform orchestration ? apart from provisioning

We used CloudFormation/Terraform for provisioning resources in AWS. Provisioning is about creating a new state or transforming one state to another. We used ansible tool to orchestrate provisioning ...
1
vote
0answers
57 views

Ansible provising with packer causes problems with sudo?

So, I have a packer template that sets up a VM and then uses Ansible as provisioner. Within the playbook that's executed, there is a task that must be run as root. (sudo proftpd). - name: Starting ...
0
votes
1answer
27 views

Build Docker Images with Ansible + Vagrant

So I am working on a research project and I am trying to automatically generate specific environments on different virtualization techniques. So, first I made a Vagrantfile that pulls an Ubuntu ...
2
votes
2answers
42 views

How to use edited inventory file?

I have workflow with 2 templates. First I add new host to my hosts.ini file: - name: Add to host file blockinfile: path: /var/lib/awx/projects/_52__glusterfs/hosts.ini block: | ...
2
votes
2answers
18 views

Ansible configure and compile in directory

So I have have an Ansible Task that extracts a programs sourcecode zip into a certain directory and is then supposed to compile and install it. The extraction of the zip works fine, but then I need to ...
0
votes
1answer
32 views

How deploy public key to newly created VM on GCP?

I create VM instance using ansible module gcp_compute_instance My code: --- - name: Create jenkins node-1 hosts: localhost connection: local gather_facts: no vars: address: <my ip> ...
2
votes
1answer
19 views

How to verify hashes of Ansible Galaxy dependencies?

From a security perspective, I don't like the idea of relying only on Git tags, as they could be moved later. Unfortunately, I'm not aware of an official solution to enforce checks. This is the best ...
0
votes
1answer
132 views

Ansible: What's the difference between task, role, play and playbook?

Ansible has tasks, roles, plays and playbooks. Are those just names for different levels in a playbook organization? If not, how, exactly, do they differ from and relate to each other?
2
votes
1answer
35 views

How I can use multiple hosts in AWX playbook?

I have workflow that create 2 virtual machines on GCP. When virtual instance created I store output with external ip to variable. In next playbook i want to use all of my ip addresses in host section. ...
0
votes
1answer
44 views

Where do I use Ansible and where is Terraform used? ( Strengths & Weaknesses) [closed]

What is Ansible mainly used for? Where do I use Terraform? This question focusses on where the tools have relative strengths or weaknesses. For example: Ansible for VM build and Software ...
1
vote
2answers
85 views

Given a blank slate, tool recommendations? [closed]

so I have 8 months of DevOps experience previously working as a desktop engineer for two and a half years.Starting a new role in the education sector, recently they brought their IT department which ...
0
votes
0answers
103 views

Ansible - remove named cron job with file specified

I'm creating and trying to remove cron jobs based on a flag like this: - name: process files cron cron: name: process_files cron_file: "process_files_{{item.name | regex_replace ('[.-]', '...
1
vote
1answer
91 views

How to make sure the specified Azure vm size available?

I am trying to create a VM with a playbook like this: tasks: ... - name: Create VM azure_rm_virtualmachine: resource_group: AnsibleResourcEGroup name: AnsibleVM vm_size: ...
2
votes
0answers
75 views

How to programmatically generate docker-compose file? [closed]

I am writing an Ansible playbook to deploy services to a clustered environment. There are 3 types of hosts (Application, Load balancer, database). Services are deployed via docker-compose on each host ...
4
votes
1answer
72 views

Why is developing Ansible Playbooks using Roles a best practice?

It's a best practice to develop Ansible Playbooks with reusable roles. From what I've seen, people end up putting all their roles into a single complex files anyways. So it doesn't really fix the ...
2
votes
1answer
40 views

Check connectivity of 5000 + servers from ansible and get list of hosts which are connectable and which are not

I need to check connectivity of hosts on port 43. I can manually login and check connectivity by: nc -v `hostname` 43 nc -v `hostname_1` 43 Is there any ansible script that goes through all the ...
2
votes
1answer
69 views

How to get the device name of a specified mount point with ansible facts?

Using Ansible facts I can get the list of "ansible_mounts": "ansible_mounts": [ { "block_available": 423698, "block_size": 4096, "...
1
vote
1answer
39 views

Create User Using Ansible with Authenticate Pem File

Community, I am creating a user on the client machine using Ansible but the issue is it creates a user and add authenticate file but getting an error while SSH to that machine using created, User. ...

1 2 3 4 5 6