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.

Filter by
Sorted by
Tagged with
-3
votes
0answers
14 views

Ansible: Playbook for running online Updates [on hold]

I'm new into ansible and do already fancy copy/write stuff with ansible. Now I'm trying to write a playbook to upgrade various SLES Machines. I really don't have a clue how to manage this task. I've ...
0
votes
1answer
31 views

Does Ansible have the ability to suspend a Linux system?

I'm having trouble locating any modules besides rebooting and shutdown for Linux. I'm wondering if anyone has done this?
0
votes
1answer
17 views

ENTRYPOINT relative path - Ansible

We are able to run the docker container locally with docker file having relative path in ENTRYPOINT: USER user1 WORKDIR /home/user1 ADD script.sh $HOME/script.sh ENTRYPOINT ["./script.sh"] When ...
0
votes
2answers
47 views

Ansible docker_container module - How to pass variables in environment section?

In the below task: - name: Create a data container docker_container: name: mydeploycontainer image: 1111112222.dkr.ecr.us-east-1.amazonaws.com/someteam/app-deploy:v.1 env: name1: {...
0
votes
1answer
38 views

Ansible - How to remove a docker container after start?

Below is the shell command we use to launch a docker container: #!/bin/bash docker container run --rm -it \ -e name1=value1 -e name2=value2 -e name3=value3 \ 1111112222.dkr.ecr.us-...
1
vote
0answers
14 views

(Ubuntu 16.04 Server) systemd update lightdm.service from ansible

I am making an ansible script to add an extra service (VPN/Strongswan) to be loaded to lightdm.service before booting to graphical.target / graphical GUI. I am adding "strongswan.service" to the end ...
0
votes
0answers
10 views

Spacewalk reboot the server after patch installed

I am using Spacewalk release 2.9 to manage my CentOS Linux server. using below spacecmd command to push the new packages. I want to reboot the server once all the packages are installed on the machine....
-1
votes
1answer
30 views

Ansible - How to select Element in output

Im newbie when it comes to ansible started just a week ago. I was playing around with playbooks and ad-hoc command i run ad-hoc command ansible ansiblenodes -m setup -a "filter=ansible_mounts" 192....
0
votes
0answers
11 views

Getting Ansible ARA working

Please excuse me but could someone point out in simple steps how I should get Ansible ARA installed on a CentOS 7 Virtual Machine ? (or even debian) I have followed https://ara.readthedocs.io/en/...
0
votes
0answers
11 views

yum installing mysql-server 5.5 instead of 5.7 on Amazon Linux

My understanding of yum is that it should default to installing the latest version of a package available in all the repos enabled. The default repos installed in Amazon Linux 1's AMI include the ...
2
votes
1answer
24 views

Is it possible to define run_once strategy on Ansible?

I would like to run a task only on one host with Ansible. To do that, I use the parameter run_once. But what would really rock is to be able to specify a strategy to select that one host to run that ...
0
votes
1answer
101 views

Ansible replace first occurance on file

I am using Ansibles replace module, I want to replace only the first occurrence in the file. I have example string: example.string.in.my.text=test.@@sometext@@ I wish: example.string.in.my.text=...
1
vote
1answer
39 views

Ansible get a list of certification files and check their expiration date

I am trying to figure out how to get a list of .crt files from one of our web servers and check the expiration date of these certification files (actually check if these certs are valid within a time ...
0
votes
0answers
18 views

How to save svn credentials via Ansible

I have an ansible role which will setup a Subversion server, create users with the htpasswd utility. The login of users manually work fine. However I have some scripts that will run later on via ...
2
votes
1answer
53 views

Transfer RPMs file with Ansible and localinstall them

I am having the following yaml ansible-playbook and want to transfer the rpms and then localinstall them on the remote machine. Until the transfer file step its working fine however on the ...
0
votes
1answer
35 views

Execute command using Ansible

I want to use the dpkg -l | grep -i staff command using ansible, but it gives me an error: ansible all -m 'dpkj -l | grep -i stuff' ERROR! this task 'dpkj' has extra params, which is only allowed ...
1
vote
1answer
25 views

ansible template module permission error

Snippet of my yaml code: - name: 11|Copy sw-installer.jinja2 response file for unattended installation template: src: "{{ CNTRL_SERVER_RSP_FILE_DIR_LOCATION_FOR_INSTALL }}/sw-installer....
0
votes
1answer
22 views

Accessing variable value from inside ansible playbook

I have used the following variable in ansible playbook as shown below. --- - hosts: hosts vars: vers: 18.7 I am trying to access the value of vers using $ under tasks as shown below ...
1
vote
1answer
41 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
40 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
35 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
24 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
1k 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
104 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
2answers
42 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 - ...
0
votes
1answer
216 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 & will ...
2
votes
0answers
53 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
115 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
164 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
1k 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
123 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
183 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
33 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
210 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
346 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
666 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
357 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
166 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
2k 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
344 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
592 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
102 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
48 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
103 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
913 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
257 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
179 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
70 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
63 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 ...