Questions tagged [ansible]

Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management.

Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management. It manages nodes over SSH and does not require any additional remote software to be installed on them. Modules work over JSON and standard output and can be written in any programming language. The system uses YAML to express reusable descriptions of systems.

The platform was created by Michael DeHaan, the author of the provisioning server application Cobbler and co-author of the Func framework for remote administration. It is included as part of the Fedora distribution of Linux, owned by Red Hat inc., and is also available for Red Hat Enterprise Linux, CentOS and Scientific Linux via Extra Packages for Enterprise Linux (EPEL) as well as other operating systems. Ansible was commercially supported and sponsored by AnsibleWorks. Since October 2015 Ansible is owned by RedHat.

It was named by DeHaan after the fictional instantaneous hyperspace communication system featured in Orson Scott Card's Ender's Game.

1762 questions
0
votes
1 answer

No package matching 'php7.2' is available

I am trying to install php with ansible but can don't know what is going wrong. this is my ansible file --- - apt_repository: repo: "ppa:ondrej/php" update_cache: yes - apt: name: "{{ item }}" install_recommends: no state:…
0
votes
0 answers

Change ifcfg-eth* files

I would like to determine the interface name of the hosts where ansible connects and use it as a variable, but the final goal is to create an ifcfg file config for every network interface on every host in the inventory. The problem is that I have…
0
votes
1 answer

Ansible: Why cannot I get debug output

I have the following playbook, and I'd like to get the debug oupput: --- - name: Install and configure chrony hosts: '{{ hostgroup }}' gather_facts: no become: yes become_method: sudo tasks: - name: make sure chronyd is installed …
sebelk
  • 682
  • 4
  • 13
  • 32
0
votes
0 answers

How to properly define ip6tables rule in ansible

On current system I have this rule for ip6tables -A INPUT -d -p udp -m udp --dport -m state --state NEW -j ACCEPT For new system I wrote an ansible playbook: - name: Allow someport for ipv6 ansible.builtin.iptables: chain:…
GarfieldCat
  • 101
  • 3
0
votes
0 answers

How can I (re)create a LXC image with ansible?

I have a server with custom made LXC images. My users can create containers from thoses images. Until now, when I needed to change some configuration to the image, I went into a tedious workflow of making a container from the current image, applying…
SteeveDroz
  • 101
  • 3
0
votes
1 answer

How to enable and restart a systemd service after changes to their configuration

Given a set of previous task whose results I register, I want to: Enable my target service. Restart/reload it when any of the dependencies have changed.
Petr
  • 581
  • 1
  • 5
  • 16
0
votes
1 answer

Ansible regex_search module

Can anyone please help me to explain this code in ansible regex_search module: - set_fact: regex: "{{ '/opt/conf/path.txt' | regex_search('/?(.*)', '\\1') }}' What "\\1" means in this code. What is the function of each special letter in…
TRONG NGUYEN
  • 3
  • 1
  • 4
0
votes
1 answer

Load vars based on env in ansible

Team, I have two vars that map to two environments. I want to use them in playbook but only one value should be applied based on env playbook runs on. ex: var = test1 > should be loaded when env1 var = test2 > should be loaded when env2 any hint…
AhmFM
  • 119
  • 5
0
votes
1 answer

Ansible Parted, only run if no partitions exist

I want to only run the parted operation if no partitions currently exist on that device. Said parts could have been made previously or manually outside of ansible in the past and in that case should not be changed and the task skip. name: "Add Disk"…
hat
  • 3
  • 1
0
votes
2 answers

using logical operator && to validate condition in Ansible

i would create a playbook that Check configured filesystems for TSM configuration I need to echo "${FS_TSM[@]}" from register: FS_TO_ADD and to conclude it, a conditional must be set to debug the FS_TSM [[ ! -z "${FS_TO_ADD}" ]] && { FS_TSM+=(…
medisamm
  • 1
  • 1
0
votes
2 answers

Automatic way to find where variables are coming from in Ansible

Whenever I have to change something in our Ansible repository, I have to check all the places where a variable could be set and that's very time consuming. Is there something that would show me something like "the varialbe X being used in this…
gtirloni
  • 5,746
  • 3
  • 25
  • 52
0
votes
1 answer

Ansible | conditional statements should not include jinja2 templating | when group_name variable

I have a simple ansible main_task.yml file which is looped from a main.yml . inventory.ini [port_22] 192.168.0.189 192.168.0.199 [port_222] 192.168.0.199 [port_888] 192.168.0.200 main_task.yml --- - name: "run this on {{ item }} hosts" debug:…
0
votes
1 answer

Write original Ansible variable to xml file

I'm trying to find a way to write the original {{ ansible_host }} var in to a xml file. This variable will replace a static IP in a device config. The reason that I want to replace this IP with the original variable in the file, is because later in…
Collega
  • 65
  • 6
0
votes
1 answer

Ansible "hip-profiles unexpected here" Palo alto panos_security_rule

I'm trying to set a security policy on my Palo Alto firewalls using Ansible with the panos_security_rule module. However, I keep running in to the same error, hip-profiles unexpected here. I found multiple reports on the problem, even a GitHub issue…
Collega
  • 65
  • 6
0
votes
0 answers

AWS Peering connection with ansible: "No route to host"

I have an EC2 instance in us-east-1 which would like to communicate with another instance in us-west-2. VPC-East CIDR: 172.16.0.0/16 VPC-West CIDR: 172.17.0.0/16 The used subnets in these VPCs are 172.(16 or 17).0.0/24 correspondingly. I've created…
Tudvari
  • 101
  • 3
1 2 3
99
100