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]

Ansible is an automation tool ("IT orchestration engine", per the company web site) for the deployment and configuration of applications and systems.

1
vote
1answer
35 views

Linux Mint Infrastructure Management [closed]

I want to deploy Linux Mint on ~40 PCs. If I do that, I will need a centralized way to control those PCs. For Example, install/remove software on all those PCs on the same time, set environment ...
0
votes
1answer
28 views

Ansible User module removes sudo configuration. Why?

An Amazon Linux 2 machine is configured with a user that can sudo without password as follows: # Add user sudo groupadd -g 2002 one-username sudo useradd -u 2002 -g 2002 -c "One Username Account" -...
1
vote
0answers
27 views

PXE boot a computer using Ironic Bifrost

I am using Openstack Ironic standalone using Bifrost. I followed this link link https://docs.openstack.org/bifrost/latest/install/index.html#introduction to install Bifrost on CentOS system in ...
-1
votes
1answer
20 views

Defining Ansible inventory on remote server

What specific changes need to be made to the code below so that the Ansible Playbook will know how to pull testFile.txt from ServerB into ServerA? These are both Amazon Linux servers. Note that ...
2
votes
1answer
174 views

yum lockfile is held by another user

Amazon Linux 2 instances are operated upon by an Ansible Playbook which performs multiple yum tasks one after the other. What specific changes need to be made to the syntax below in order for the ...
0
votes
1answer
43 views

Ansible mysql_* modules show error at first launch

This is my yml file which should update system, install mysql-server, change binding and run steps from "mysql_secure_installation". --- # tasks file for deploy_db - name: Update repos apt: ...
1
vote
1answer
27 views

Deploy different roles on different servers using one playbook

F.e. I created two roles via "ansible-galaxy init": deploy_back and deploy_front Also I wrote a playbook.yml file. - name: Create cluster become: yes hosts: all roles: - deploy_front - ...
-2
votes
0answers
34 views

Oracle WebCenter 12C Portal Domain Configuration using Ansible

I'm trying to configure Weblogic WebCenter 12C Portal Domain via Ansible on CentOS 7, but still can't find the way how to do it. So far I could install weblogic and weblogic portal with DB via Ansible....
0
votes
1answer
55 views

Ansible: difference between “shell” and “command” modules

Ansible wiki says: The given command will be executed on all selected nodes. It will not be processed through the shell, so variables like $HOME and operations like "<", ">", "|", ";" and "&" ...
2
votes
0answers
34 views

Ansible firewalld - guaranteed final state?

The ansible firewalld module is great for adding rules, but old rules are left in place. How can I achieve a guaranteed final state using the firewalld module? Specifically, I would like a role that ...
0
votes
1answer
57 views

fetch dependencies while install deb with ansible

i'm trying to install mysql 8.0.15-1debian9 on a debian 9 server the problem is that mysql only provides the latest version of mysql in their apt repository which is 8.0.16-1debian9 however 8.0.16-...
2
votes
2answers
159 views

Encrypt a file on remote host

How to encrypt a file on the remote host using Ad-Hoc command 'ansible-vault'. for example, a myfile.txt on a remote machine needs to be encrypted from the host machine
0
votes
3answers
281 views

Run shell command from Ansible

I have a shell script which just changes directory (here directory path is given). shell file #!/bin/bash p="dir/file/create" cd "$p" exec bash Ansible playbook --- - hosts: localhost ...
0
votes
1answer
72 views

how to run playbooks in ansible parallel

site.yml --- - import_playbook: common.yml - import_playbook: redis.yml - import_playbook: riak.yml - import_playbook: webserver.yml - import_playbook: haproxy.yml I want to run these playbooks in ...
1
vote
2answers
29 views

It is possible to define an ansible.cfg file as the main config for only one role?

I would like to run the 'ssh' role without the become directive and run my others roles run with the become directive I decided to create an another config file ansible_ssh.cfg which not contains the ...
1
vote
1answer
100 views

Ansible dnf module: “MODULE FAILURE”

I am seeing the Ansible dnf module fail. But not reliably. When it does fail, it seems to succeed if I run Ansible again. My system is Fedora 29 Workstation. (More version information is shown ...
0
votes
1answer
28 views

Ansible: Iterate over variables and run command if variable is defined

I want to set nameservers in /etc/resolv.conf using ansible. I basically want to set variables (DNS1, DNS2, DNS3). I only want to apply DNS# if it is defined. I have the following so far. # Run this ...
0
votes
0answers
139 views

ansible unarchive module not working as intented!

i am using ansible unarchive module,, cassandraDir = /opt/con/cassandra cassandra package = /tmp/apache-cassandra-3.7-bin.tar.gz I need to unzip the cassandra package in the "cassandraDir" ...
0
votes
1answer
110 views

Ansible modules copy/template errors for Linux 5 hosts using python26 ,python binding libselinux-python needed

We have some 50 odd linux 5 hosts, and to manage that we use ansible. Problem :- Ansible modules copy/template errors for Linux 5 hosts using python26 ,python binding libselinux-python needed ...
0
votes
2answers
212 views

how to use included variable from file with jinja2 template and with_items

I am having an error where the fields of my variable are not being detected when trying to build a configuration using a jinja2 template. This is to sync Linux repositories to yum and apt based ...
0
votes
0answers
202 views

How can I prompt users while running a playbook?

My needs: Write a playbook which can install apache if the user wants to, while the playbook is running by typing yes or no. apache_prompt.yml hosts: slaves vars_prompt: - name: ...
0
votes
1answer
103 views

How to change the user after connecting to the jump host when using ProxyCommand

My normal flow is like: ssh jumphost sudo -iHu jump_user ssh target_user@targethost Do some task How to do this using ProxyCommand? I have tried: ssh target_user@target_host -o ProxyCommand="ssh ...
1
vote
1answer
1k views

Ansible task for searching words

With my ansible task I wanted to check if openjdk is installed on environment. - name: Check if java is installed on environment shell: rpm -qa | grep 'openjdk' register: result As result I ...
1
vote
1answer
158 views

If condition in ansible jinja2 template

Search keyword in "host_fqdn" variable. If the value has "lab.com" keyword in it, it should directly store the value to "host_fqdn" again or else it should add "lab.com" keyword to the value and store ...
0
votes
2answers
329 views

Ansible jinja2 filter reject

I need to reject "*" from stdout lines. "stdout_lines": [ "rchinnn01", "rchinnn02", "*" ] - set_fact: nfs_clients: "{{ nfs_clients_out.stdout_lines | reject(...
1
vote
1answer
100 views

Arch: Is there any chance to use Apache all default for 2 or more virtual hosts?

I consider establishing an Arch based LAMP. From reading this document, it seems there is must configuration to be done just for Apache itself, not to mention MySQL and PHP. In Debian LAMP there's ...
0
votes
1answer
47 views

LAMP DB-agnostic way to create a DB stack

Is there a LAMP-MySQL (or equivalent) agnostic way to create a DB stack that includes: DB-user and a relative password DB with the same name as of the user Setting a host for the DB (say, localhost) ...
0
votes
0answers
74 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 ...
8
votes
4answers
892 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
160 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 ...
2
votes
2answers
167 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
63 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
51 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
53 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
317 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
369 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
49 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://...
2
votes
1answer
144 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
69 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
193 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
267 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
114 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
696 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 ...
2
votes
1answer
798 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
274 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
vote
2answers
194 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
vote
2answers
156 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
413 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
857 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 ...