Stack Exchange Network

Stack Exchange network consists of 175 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]

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.

0
votes
2answers
17 views

Get Ansible to print lines for include_role(s)

I figured this would be trivial, but can't find the answer anywhere. Let's say I have a playbook.yml that looks like: - hosts: all tasks: - name: I'm a block! block: - name: I'm a role! ...
0
votes
1answer
26 views

ansible does not play roles and tasks

I'm learning ansible and I'm having a problem, when I run my playbook, it only runs the gather_fact task and does not play my roles. On the other hand when I run just a module with the ansible ...
0
votes
1answer
10 views

Ansible: Copying different files to different guests for use with the same role

I have a role, let's call it apache2. The role installs apache2 and all of its dependencies. Now I have two machines, let's call them M1 and M2. Both M1 and M2 need to have apache2 installed. However,...
1
vote
2answers
35 views

Ansible authorized copy from remote source to remote destination

How to use ansible authorized_key to authorize a ServerA (not the controller machine) to access Server B. Scenario: Need a playbook to execute from a ansible controller that should append id_rsa.pub ...
3
votes
1answer
44 views

Override Ansible task parameters from role

I'd like to be able to define a task with default parameters: - name: Create a new user user: name: "default" password: "password" state: present Then, from my playbook, I'd like to be ...
1
vote
1answer
22 views

Getting rid of redundant Ansible roles

I currently have a bunch of roles, like: apache2 gcc gedit ...etc. For each of those, I have a task file that looks like this: --- - name: "Install {{ role_name }}" become: true package: ...
2
votes
1answer
65 views

Structuring Ansible playbooks for low volume, purpose-built images

I hope this question is not too vague / opinion-based: I need to create and maintain a handful of virtual machines that get packaged up and deployed out to thousands of users, depending on specific ...
0
votes
1answer
25 views

Ansible cloudformation vs cloudformation

I would like to know the difference between - AWS cloudformation - Make AWS cloudformation template through Ansible (https://docs.ansible.com/ansible/latest/modules/cloudformation_module.html) I ...
0
votes
1answer
21 views

unable to save register value even if the play is skipped!

I have situation where i fetch some ip address on the fly with this play, when env variable is passed as prod, i have to fetch ip in a diff way then when i am in QA env. If env is prod the 1st play ...
0
votes
1answer
20 views

Looping through found files in Ansible

I am trying to set the sendmail_path to use Mailhog in all php.ini files on a server with multiple versions of PHP installed for PHP FPM. Why is the following snippet is not working? - hosts: ...
0
votes
1answer
20 views

Looking for Ansible equivalent method to yml Anchors, Aliases, when using include file

Using Ansible with the aci_rest module, requires the authentication parameters (hostname, username, password, method, validate_certs) to be defined in every task e.g. aci_rest: hostname: "{{ ...
0
votes
1answer
44 views

How can I check for an installed packaged version on multiple linux hosts?

i need to check more than 100 servers for the snapd package, but I don't like the output at all. I searched all day for different options without luck. Attached is the output of ansible-playbook. Any ...
3
votes
1answer
76 views

How to have Ansible move a microservice?

I am working with a microservices application that is using Ansible to deploy to a fleet of VMs. We have different numbers of replicas of each microservice type running across the VM fleet. ...
0
votes
1answer
29 views

How to add LDAP group for ssh access by ansible playbook?

I have LDAP Group. superproduct1 In LDAP Group has some users: developer1, tester1, analitic1, project1 I want to create ansible playbook for add LDAP group to SSH access on host. Found only ...
1
vote
1answer
31 views

Chef vs Ansible: will configuration be applied if connection is lost during configuration pulling/pushing?

Scenario Configuration management tools like Ansible or Chef often have a master/controlling machine and the machines they are controlling (agents). Question What if the connection between master ...
0
votes
1answer
47 views

ansible aws windows ec2 - Internal Error: this connection module does not support running commands via sudo

I am getting below error when I am trying to run one playbook which connects to Windows machine hosted on AWS EC2. I enabled winrm and win_ping worked fine but when I am invoking ansible-playbook I am ...
0
votes
1answer
22 views

How can I issue a Let's Encrypt certificate with Ansible when 'challenge_data' cannot be found?

I am attempting to use the Ansible acme_certificate module to acquire a Let's Encrypt TLS certificate. I have successfully generated the private keys, CSRs, etc, and then started the challenge using ...
5
votes
2answers
82 views

How can I eliminate the need for an Ansible control machine?

Ansible is great for deploying infrastructure, but it requires you to have a control machine. This adds the burden of manually setting it up and securing it, and then pulling down your playbooks and ...
1
vote
3answers
105 views

Can Ansible use a local repository?

I have multiple hosts and my playbook has apt, pip modules to download necessary packages from repositories. When any (apt,pip) download module attempt to download packages, it does it for each host ...
0
votes
1answer
16 views

Can I check whether ansible is on last batch of rolling update (serial: 25%)?

I'm using Ansible to update a pool of EC2 servers with a rolling update, in batches of 25%. In between batches, I'm pausing long enough for the server health checks to start to pass again (since they'...
0
votes
0answers
26 views

Need help with massaging data from ansible modules

I have retrieved data from Azure using the azure_rm_*_facts modules, and have ended up with some data (after tweaking) like this: { 'nics': [ { 'fw01port01': { 'ip': '10....
2
votes
1answer
56 views

Ansible How to use plugin parameter

In Ansible, I want to use a plugin parameter. For example, the profile_tasks plugin supports a parameter to "Adjust the sorting output of summary tasks". I enable this plugin by whitelisting it in ...
3
votes
1answer
103 views

Ansible how to know what return value is provided by a specific module

From Ansible's official doc Ansible modules normally return a data structure that can be registered into a variable, or seen directly when output by the ansible program and Ansible modules ...
0
votes
1answer
48 views

Trying to execute an appcmd command via Ansible [closed]

I trying to execute the below command and running into errors ... I tried with quoting around the arguments, that didn't help either - name: Add authorization rules to FTP site win_command: ...
3
votes
1answer
61 views

Configuring Zookeeper from Ansible

I'm trying to configure a Zookeeper Cluster with Ansible. As you might know Zookeeper has two important config files. zookeeper/conf/zoo.cfg I create this file on each cluster member using this ...
7
votes
1answer
701 views

How to solve “E405: Remote package tasks should have a retry” in Ansible?

E405 v4.0.0 Remote package tasks should have a retry Package operations are unreliable as they require network communication and the availability of remote servers. To mitigate the potential ...
5
votes
3answers
88 views

What are tools that lend themselves for backup and recovery in a CI/CD environment?

I have used tar, dump, Amanda, Legato (EMC) Networker and other backup software for making backups of systems. However, I don't know the best tools for making backups in a CI/CD (Continuous ...
3
votes
2answers
112 views

Is there a system which automates everything (OS release, and above) to host websites on?

This is not really a DevOps question but more of a System Automation question (which DevOps covers only a part of, by popular opinion, so I hope it's okay). I feel like some 5 USD IaaS VPS with ...
0
votes
2answers
88 views

Should local Ansible playbooks be loaded each day/week with cron?

I ssh into a remote 5$ debian:stable IaaS machine with Putty. The machine has only debian:stable and Ansible installed on it and I run an Ansible playbook locally on it with my current working user (...
-1
votes
2answers
143 views

Ansible: Difference between the apt module and command: apt-get -y install X (module)

Consider these YAML tasks which are based on two different parts of some locally-executed Ansible playbook I read here: - name: Update the apt package-index cache i.e. apt-get update apt: ...
0
votes
2answers
55 views

Is there a book only about Ansible (without touching Vagrant, VirtualBox, Docker and virtualization stuff)?

I need a book only about Ansible (without touching Vagrant, VirtualBox, Docker and other above-shell stuff). About 6 months ago I tried reading the Ansible docs but these were totally un-...
0
votes
2answers
42 views

What Ansible does in cases there's a conflict between OS version and some software Ansible manages?

Say I use an IaaS cloud on which I installed Ubuntu 18.04 manually via the cloud company's OS installation tool and I ought to establish an all-ansible LAMP environment that will include some more ...
-1
votes
1answer
46 views

A cloud technology with automatic upgrades of my OS-release and web server release?

I desire a cloud technology that will redund my need of using Vagrant to continuously integrate OS release upgrades (say from Ubuntu 18.04 to 20.04 including all software installed by apt-get --- ...
0
votes
2answers
72 views

ansible task -easy_install with requirements.txt file

I want to run easy_install task in order to install many modules in virtual environment. Is there an option to install all modules in requirements.txt file? as I understand it accept only one module ...
3
votes
2answers
36 views

Is it possible to consolidate notification handlers when they are very similar?

I have an Ansible role which uses handlers to restart services via the systemd module. - name: restart ntp systemd: name: ntp enabled: yes state: restarted become: true - name: ...
1
vote
2answers
27 views

Can a 5 US $ VPSE support VAD stack with 2 relatively-small CMSs?

I'm new to DevOps and quite troubled financially but I desire to put websites that I now host on a shared server environment (CetnOS 12.x.x) on some cloud like DigitalOcean or Lindoe (but without ...
0
votes
0answers
123 views

Background process not running after executing shell script

When I execute below script from cli it is working and process in background also running. But when i try to execute the same wcript from ansible all the tasks are successfully executing but ...
-1
votes
1answer
30 views

VAD (Vagrant-Ansible-Docker) stack for Ubuntu and Apache

I'm having trouble establishing a Ubuntu-LAMP environment with continuous integration - I feel lost from the different solutions out there and time and again I fear that my vanilla-Bash Ubuntu-LAMP ...
5
votes
1answer
119 views

How does Vagrant differ from Ansible and Docker?

I understand that Ansible is a Configuration Management (CM) tool for orchestrating, deploying (and continuously upgrading) software and conf via a special YAML format created for that software, and ...
2
votes
1answer
239 views

How to test an ansible playbook using molecule inside docker locally?

When molecule is run on travis, the build is successful: $ molecule test --> Validating schema /home/travis/build/030/ansible-firefox/molecule/default/molecule.yml. Validation completed ...
1
vote
1answer
101 views

How to exclude a certain linenumber of an Ansible playbook when testing it using Molecule?

The aim is to exclude a certain line that contains a checksum and cannot be smaller than 80 characters. --> Scenario: 'default' --> Action: 'lint' --> Executing Yamllint on files found in /...
1
vote
1answer
61 views

How do I return just the full path of a file found with the find module in Ansible?

This has been reworded, expanded upon and clarified via an update late on 11/9/18. I request it be upvoted now that it has enough code. I want to find a softlink (to another file) in the $PATH ...
5
votes
3answers
107 views

Ansible Find Module

I am trying to use the Ansible find module to create a list of files to pass to the file module to change file permissions on files owned by a specific user in a directory that contains files owned my ...
2
votes
1answer
998 views

Jenkins-Ansible: executing ansible playbook using jenkins pipeline script

We developed declarative pipeline code to execute an Ansible playbook. We tested the playbook from CLI and it is working properly. My playbook actually performs some shell commands on remote server. ...
0
votes
2answers
49 views

Choice for scheduled task in AWS

I have deployed an AWS Lambda with Python 3.6 and CloudFormation executing a scheduled task which writes a JSON file once a minute to an S3 bucket. Now I wonder if this is a good way of doing it, or ...
1
vote
1answer
73 views

Cannot pull ansible docker image

$ docker pull ansible/ansible Using default tag: latest Error response from daemon: manifest for ansible/ansible:latest not found I try and get started with ansible but I get the above error message ...
1
vote
0answers
174 views

ansible AWX is connecting through ssh as root instead of user defined in credential

Hello I am running ansible 2.6.2 and awx 1.0.7.2 on rhel 7.5. AWX is connecting to my ssh proxy as root instead of the defined Credential user. My playbook contains the following become: yes ...
1
vote
1answer
2k views

Passing variables between scripts in a Jenkins pipeline

I have a declarative Jenkins pipeline that looks like the following: pipeline{ agent { ... } stages { stage("Provision EC2 Instance and Set ENV Variable"){ ...
0
votes
1answer
139 views

vagrant box tests in gitlab-ci

I have a vagrant box, provisioned with Ansible that needs testing on github pull requests. Is it possible to setup CI test suite for the mirror in gitlab-ci without extra expenses on droplets? Or ...
0
votes
0answers
112 views

How can I get gs_secret_key and gs_access_key to use gc_storage module in Ansible

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 ...