From ff0f8993ec68c3f05a2218f99a7dd24dac92a1ef Mon Sep 17 00:00:00 2001 From: Sean Perry Date: Wed, 17 Aug 2016 13:54:46 -0700 Subject: [PATCH] Detect OS type. First round of support for #1. --- playbooks/roles/install/tasks/core.yaml | 2 ++ playbooks/roles/install/tasks/python.yaml | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/install/tasks/core.yaml b/playbooks/roles/install/tasks/core.yaml index 37d5fcb..3c782f1 100644 --- a/playbooks/roles/install/tasks/core.yaml +++ b/playbooks/roles/install/tasks/core.yaml @@ -6,6 +6,7 @@ with_items: - build-essential - git + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' become: yes - name: user desired packages @@ -14,6 +15,7 @@ update_cache=yes cache_valid_time=86400 with_items: user_packages + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' become: yes - name: Make repos dir diff --git a/playbooks/roles/install/tasks/python.yaml b/playbooks/roles/install/tasks/python.yaml index f17ae9d..ae44576 100644 --- a/playbooks/roles/install/tasks/python.yaml +++ b/playbooks/roles/install/tasks/python.yaml @@ -4,7 +4,8 @@ update_cache=yes cache_valid_time=86400 with_items: python_packages - sudo: yes + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' + become: yes - name: Python tools and bits pip: @@ -12,4 +13,4 @@ with_items: - virtualenv - tox - sudo: yes + become: yes