Hot answers tagged


This can be done with two tasks with loops: # tasks/packages.yml - name: pkgs | Ensure Good package: name: "{{ item }}" state: present loop: "{{ packages['present'] }}" - name: pkgs | Ensure Bad package: name: "{{ item }}" state: absent loop: "{{ packages['absent'] }}" This will loop over all ...


Cloud setup could be done completly by Terraform. Check out terraform provider resources for required parameters ex. Azure Data Factory Configuration management stuff mostly in use for OS tuning inside Virtual Machines. So maybe you don't need them at all.


I recently made myself a small script that seems to do the work. It certainly can be done better but maybe you can get some inspiration: #!/bin/bash set -e if [ -z "$1" ] then echo "No host patter supplied. Please provide a host pattern that would match only one host form the inventory." echo "Usage: ansible-ssh <...


I also tried to make something more "practical" so i just search a bit around and found the task: "include_role" which allows loops. So i decided to loop that task with my target roles and use a when. Here the snippet: - name: "Redhat" hosts: all become: yes tasks: - name: ADD Roles include_role: name: &...

Only top voted, non community-wiki answers of a minimum length are eligible