Skip to content

Instantly share code, notes, and snippets.

@RyanSquared
Created April 16, 2018 19:58
Show Gist options
  • Save RyanSquared/dabb1643075e5eb6ccb4d55114b6e7d9 to your computer and use it in GitHub Desktop.
Save RyanSquared/dabb1643075e5eb6ccb4d55114b6e7d9 to your computer and use it in GitHub Desktop.
Ansible stuffs
[defaults]
inventory = ./hosts
[localhost_group]
localhost ansible_connection=local
---
- hosts: all
become: yes
tasks:
- name: "Load packages data"
include_vars:
file: packages.yml
- name: "Install APT packages"
apt:
name: "{{ packages | map(attribute=distro_name) | list }}"
state: present
when: ansible_os_family == "Debian"
packages:
- name: vim
ubuntu: vim-nox-py2
- name: py3
ubuntu: python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment