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 automation tool ("IT orchestration engine", per the company web site) for the deployment and configuration of applications and systems.

0
votes
0answers
16 views

How can I import an OVA into RHEV oVirt with Ansible

I am using both Ansible and RHEV and notice there does not seem to be a way to import an OVA into a RHEV oVirt environment using the Ansible oVirt VM module. I have a prebuilt VM I exported as an OVA ...
7
votes
3answers
784 views

Is there a distro-agnostic configuration management software?

I don't want to label myself to specific configuration-manager modules like Ansible's apt module or yum module. Is there a distro-agnostic configuration management software, or at least one with ...
0
votes
1answer
25 views

Ansible configuration file

I have my Ansible.cfg file in /etc/ansible/ as well as /apps/ansible/ We have made all the required setup in /apps/ansible/. Now, I have created new user and have all the ssh keys setup for the client ...
2
votes
2answers
127 views

How to enable or disable Apache modules in a distro-agnostic way?

I usually work with Debian/Ubuntu as a basis for Apache and recently learned that commands like a2enmod MOD or a2dismod MOD are Debian-specific. Is there a global / distro-agnostic way (maybe with ...
0
votes
1answer
49 views

Why does upgrading through Ansible commonly considered “idempotent”?

I know that an idempotent function returns a result which is can be returned more than once without changing the application essentially (like adding zero to a number or multiplying that number by 1). ...
0
votes
1answer
32 views

What's the difference between CMs “push” method (Ansible) to “pull” method (Chef/Puppet)?

I know that some of the advantages of Ansible over many other CMs are these: Ansible's scripts being written in YAML, a simple serialization language. The fact that one doesn't have to install it on ...
0
votes
0answers
39 views

Is there an Ansible command to check all essential logs of a web server environment?

I use Debian stable and Apache 2.4. In the past I wrote a script with 3 different commands to read all logs of my webserver. Like: #!/bin/bash nginx -t && echo;echo;echo tail /var/log/...
0
votes
1answer
50 views

How to run Ansible playbooks only if there are no problems in the playbook?

I have learned of the command ansible-playbook example.yml --check which can tell me if something in my playbook is problematic (as far as Ansible can recognize). I think I should combine this ...
1
vote
3answers
326 views

What's the advantage of mere Ansible on mere shell-scripting if one doesn't use communally-maintained Ansible-Galaxy roles? [closed]

I establish a LAMP with a few extras on a remote Debian machine with a similar shell (Bash) script: #/bin/bash apt update -y apt upgrade ufw sshguard unattended-upgrades wget curl git zip unzip tree ...
1
vote
2answers
42 views

Can kernel upgrades be done with configuration management (CM) tools for above-OS software?

I use various Linux Distros, mostly Debian-based, usually all default (I change nothing in the kernel/shell or internal-utilities (utilities that come with the distro). I usually install Apache, MySQL ...
0
votes
1answer
20 views

What are the basic files (dirs and regular file) in Ansible-Galaxy roles? [closed]

I have an Ansible playbook for establishing LAMP environments on remote machines. Part of this playbook deals with installing Composer: - name: Install Composer get_url: url: https://...
1
vote
1answer
33 views

Is it a best practice to use Ansible-Galaxy roles in playbooks instead ansible-modules in playbooks? [closed]

I have an Ansible playbook for establishing LAMP environments on remote machines. Part of this playbook deals with installing Composer: - name: Install Composer get_url: url: https://...
0
votes
1answer
36 views

Changing PHP's post_max_size and upload_max_filesize with Ansible

Is there a way to change the two famous PHP variables post_max_size and upload_max_filesize in php.ini in a version-agnostic way with Ansible? I didn't find any literature covering this and it seems ...
0
votes
1answer
50 views

How to install Composer with Ansible?

In Bash I usually install Composer this way: curl -sS https://getcomposer.org/installer -o composer-setup.php php composer-setup.php --install-dir=/usr/local/bin --filename=composer I tried to read ...
0
votes
1answer
19 views

Which modules are available in ansible ad-hoc commands?

I am working on Ansible. I see that we create roles and then under "tasks" folder we create main.yml. In this file, we specify which commands should be performed for this specific role. While writing ...
0
votes
1answer
73 views

Ansible orchestration for ufw with ufw --force enable

I deploy an Ansible playbook to some debian:stable machines aiming to update package index cache, install ufw and setup it in the Ansible architecture-agnostic and version-agnostic way. - name: ...
0
votes
1answer
91 views

What does cache=yes mean in apt: update_cache=yes in Ansible?

I know that apt update updates existing package-indexes on a supporting distro but not upgrading installed-packages (utilities) that were being installed based on these package-indexes (as apt upgrade ...
1
vote
1answer
27 views

Ansible command returns change instead of success

I'm learning ansible and encountered a situation which is not clear. Running the following module command the result is a 'Changed'. ansible agent.example.com -i inventory -m copy -a 'content="Node ...
1
vote
1answer
29 views

Ansible - Add a word to a specific line in a specific part of that line

I want to add the word "nodev" to the line that contain /home in /etc/fstab file here's the file before UUID=2ea6e2e5-d902-4289-b516-40c175cd481b / ext3 defaults 1 1 ...
-1
votes
0answers
12 views

Filter specific string from file content and it needs to be looped into mail module

I have multiple files in a path and it contains mail id of the users. I need to loop the file content using with_items and filter user's ID from the file content. That ID's should be passed into mail ...
1
vote
3answers
172 views

read-verification alternative (two prompts and if-then comparison alternative)

I am trying to create a small script for creating simple, all-default Apache virtual host files (it should be used any time I establish a new web application). This script prompts me for the domain....
-1
votes
0answers
46 views

When adding a new hard disk to a running VM, do I still need to scan for new SCSI devices?

End Goal To automate the addition/extension/formatting of a new disk onto a running Linux host using vSphere and Ansible. Dilemma I'm not a huge fan of writing such automation when I don't fully ...
1
vote
2answers
104 views

Using Ansible inside Bash

I use Ubuntu 18.04 with Ansible installed this way: apt-get update -y install software-properties-common apt-add-repository ppa:ansible/ansible apt install ansible I also have a small Bash script I ...
1
vote
1answer
73 views

Ansible, docker_container and depends_on

I am using ansible and docker_container module. But when I start my playbook, I have error like: "'depends_on' is not a valid attribute for a Task" This is my playbook: - name: Docker-compose ...
1
vote
2answers
94 views

Ansible Playbook: Get value from variable

I'm writing my first ansible playbook right now. That's what I have so far. --- - hosts: kolumbus become: yes tasks: - name: Copy RPM copy: src: "{{ item }}" dest: /tmp ...
1
vote
0answers
42 views

not run expect script in ansible

my script is : #!/usr/bin/expect set timeout 1 spawn /etc/init.d/oracleasm configure expect "Default user to own the driver interface []:\r" send -- "grid\r" expect "Default group to own the ...
0
votes
2answers
29 views

How do i store a variable value to a file in new lines on ansible

I would like to store the variable value to a file in new lines format. - set_fact: linked_dirs: "{{ linked_dirs.stdout_lines | select('search',nfs_server) | list }}" - debug: var=linked_dirs ...
0
votes
0answers
50 views

How do I map the fields from the stdout_lines in ansible?

I would like to map the fields from the output of the "std.out_lines". Below is my output. > ok: [rchdata01] => { > "msg": [ > "host_name criticality server_loc ...
4
votes
1answer
155 views

ansible.cfg become_ask_pass not working

I am using Ansible 2.5.1., and I do not want to use the flag -K all the time (I think it will be deprecated soon). I know there is a directive of become_ask_pass in the ansible.cfg file. I set this ...
0
votes
1answer
123 views

How to specify range to iterate through an array in ansible

I want to remove an application on a remote node using ansible. Below is my playbook. How do i provide a range to the uninstall task to repeat till no packages are left. --- hosts: all tasks:...
0
votes
1answer
21 views

ansible block of code

I need to create an xml formated file in ansible. The file contains <> and spaces. When I run the playbook without the <> or any white spaces between lines in it, the playbook creates the ...
0
votes
2answers
77 views

need to list the item from facts output

I need to save the target host's IP addresses to a file using set_fact. Below is my playbook, but it's giving output as a list. hosts: all tasks: - set_fact: data: "{{ ...
-1
votes
1answer
497 views

replace specific line in file with ansible [closed]

I know how to replace strings in the file with the ansible replace module. What I am looking at is replacing a specific line. I have a file that has the same string in several places and I only want ...
0
votes
2answers
348 views

Ansible: return status of the last task

I'm using this command to have a return from tasks in ansible. To see if they are successful or not. This is a example of my code in a playbook: - name: Install JDK8 shell: cd /tmp/install/ &&...
0
votes
3answers
345 views

simulate enter key in Ansible

I am trying to create a playbook to run the mysql_secure_installation command. This command ask several questions. I am using pexpect, but not sure how to simulate an "enter" The first question it ...
0
votes
2answers
31 views

Find in Ansible and Save to a file

I want to save the result of find into the file with an Ansible play. - name: Find / -name "postgresql" find: paths: /var/log patterns: 'postgresql' The result of above will be saved into ...
0
votes
1answer
168 views

How to pass prompt in ansible?

I am trying to pass a prompt y in ansible when it executes the below command. When i do manually on server it asks for a prompt. How should i do it with ansible using shell module.Please help with ...
4
votes
1answer
1k views

Terminate and disable/remove unattended upgrade before command returns

I'm having an issue here where I try to automate a setup with Ansible. Some of the steps require interaction with apt, but occasionally I get an error because unattended-upgrade kicked off and locked ...
0
votes
0answers
40 views

The url-path name must be set to the file path name or the directory path name

So I need to make sure that the url-path is set to the file path from a httpd.conf file directive path. So I have a stig and It states If the directive uses a URL-path name that is different than the ...
1
vote
2answers
53 views

Using a if/else statement in shell for netsat

My goal is to ensure that email connections are limited to outbound only So I have two shell commands one is netstat -an | grep ':25' | grep -v '127.0.0.1' | wc -l which prints out 1 The command ...
-1
votes
1answer
346 views

Ansible Playbook syntax check issue

i have below detail in /etc/ansible/hosts [dev] 10.13.212.32 and i am able ping this hosts as below: # ansible dev -m ping Output: [root@localhost ~]# ansible dev -m ping 10.13.212.32 | SUCCESS ...
0
votes
0answers
52 views

Specify destination interface firewalld rich rules

I'd like to specify the destination interface for a firewalld rich rule using an option similar to -i with iptables. -i: specifies name of an interface via which a packet was received. I'm aware of ...
1
vote
0answers
58 views

Ansible: failed to ping a linux container

Continuig with my ansible learning, I already fixed how to Ansible: How to parse an inventory source but now I ran into a new problem. He executes the following 2 commands (but im not sure if he does ...
1
vote
2answers
2k views

Ansible: How to parse an inventory source

I'm following an Ansible tutorial I got from Packt, I reached this part where I've created 3 Ubuntu containers (lxc) and got them up and running. I'm also able to login to each of them. I've ...
0
votes
4answers
241 views

Best practice DNS (resolving IP to hostname in LAN)?

Recently I've created my own thin client operating system (Xubuntu based, so basically Linux yes) that will run across our thin clients. Currently I'm testing the OS in my test environment, but I've ...
-1
votes
1answer
148 views

ansible and continue the script with expect tools

My expect script: #!/usr/bin/expect -f set timeout 1 spawn /opt/install.sh expect "\[input\] Are you installing the application at the central data center? \[yes/no default: yes\]? \[yes\]\r" ...
0
votes
1answer
423 views

ansible and expect problem

I want to use expect tools in bash script by ansible. first, step my shell script. Checking for $JAVA_HOME variable. I set $JAVA_HOME but in Ansible, I get an error. My env for $JAVA_HOME: [root@...
1
vote
1answer
2k views

When I use ansible module expect, I get this msg: The pexpect python module is required

Some code from yml file: - name: --- run /opt/installer/bin/install.sh --- expect: command: /opt/installer/bin/install.sh responses: 'Are you installing the application at the ...
0
votes
1answer
230 views

Concatenate two commands with output on sam line Ansible shell command

I have this ansible command that is writing Docker container ip address and hostname to nginx hosts file which is running for more than 1 time. How can I join two commands and get ouput on same line ...
1
vote
1answer
275 views

Ansible copy module failure on Ubuntu 18.04 - “you may have been able to authenticate and did not have permissions on the target directory…”

I think I've used Ansible before, to control a Ubuntu 16.04 VM. I can definitely use this same task to successfully control a Debian 9 VM. However, with a Ubuntu 18.04 VM, it fails with "...