From 397248926410d62c74e0c84481b87bebf770e188 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 7 Jul 2014 20:21:13 +0900 Subject: [PATCH] ansible: use vars --- ansible/ansible.yml | 7 ++++--- ansible/hosts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ansible/ansible.yml b/ansible/ansible.yml index 7ef707e..8531b5f 100644 --- a/ansible/ansible.yml +++ b/ansible/ansible.yml @@ -1,12 +1,13 @@ --- - hosts: all sudo: yes + vars: + packages: [rsync, git] tasks: - name: Install packages action: pacman pkg={{ item }} state=installed - with_items: - - rsync - - git + with_items: packages + when: ansible_os_family == "Archlinux" # handlers: # - name: restart ntpd # action: service name=ntpd state=restarted diff --git a/ansible/hosts b/ansible/hosts index 244787b..a61818c 100644 --- a/ansible/hosts +++ b/ansible/hosts @@ -1 +1 @@ -127.0.0.1 ansible_connection=local ansible_python_interpreter=/usr/bin/python2 package_manager=pacman +localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python2 package_manager=pacman