From 096cb39c2a9954dbae6913de810e65f073315959 Mon Sep 17 00:00:00 2001
From: Varac <varac@varac.net>
Date: Tue, 14 May 2019 11:31:53 +0200
Subject: [PATCH] Move package installation to configure role (#102)

---
 ansible/roles/configure/tasks/main.yml | 21 +++++++++++++++++++++
 ansible/roles/setup/tasks/main.yml     | 23 +----------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/ansible/roles/configure/tasks/main.yml b/ansible/roles/configure/tasks/main.yml
index 487fc4ac2..33f838b1a 100644
--- a/ansible/roles/configure/tasks/main.yml
+++ b/ansible/roles/configure/tasks/main.yml
@@ -17,6 +17,27 @@
     cache_valid_time: 86400
     update_cache: yes
 
+- name: Install python deps
+  tags:
+    - package
+  package:
+    name: "{{ item }}"
+  with_items:
+    - python3-pip
+    - python3-setuptools
+    - python3-wheel
+    - python3-psutil
+    - python-pip
+
+# Openshift python module eeded for ansible k8s resource
+- name: Install openshift python module via pip3
+  tags:
+    - package
+    - pip
+  pip:
+    name: openshift
+    executable: /usr/bin/pip3
+
 - name: Set configuration directory
   set_fact:
     configuration_directory: "{{ configuration_directory }}"
diff --git a/ansible/roles/setup/tasks/main.yml b/ansible/roles/setup/tasks/main.yml
index b914e5eef..3918bafe7 100644
--- a/ansible/roles/setup/tasks/main.yml
+++ b/ansible/roles/setup/tasks/main.yml
@@ -44,26 +44,6 @@
     src: /oas/control/local/rke/kube_config_cluster.yml
     dest: /root/.kube/config
 
-- name: Install python deps
-  tags:
-    - package
-  package:
-    name: "{{ item }}"
-  with_items:
-    - python3-pip
-    - python3-setuptools
-    - python3-wheel
-    - python3-psutil
-
-# Needed for ansible k8s resource
-- name: Install openshift python module via pip3
-  tags:
-    - package
-    - pip
-  pip:
-    name: openshift
-    executable: /usr/bin/pip3
-
 - name: Configure Tiller serviceaccount
   tags:
     - tiller
@@ -215,7 +195,7 @@
 
 - name: Check if there are failed helm deployments
   tags:
-    - helmfile      
+    - helmfile
   command: 'helm ls --failed --short'
   failed_when: false
   register: helm_failed_deployments
@@ -236,4 +216,3 @@
     - NEXTCLOUD_MARIADB_PASSWORD: "{{ nextcloud_mariadb_password }}"
     - NEXTCLOUD_MARIADB_ROOT_PASSWORD: "{{ nextcloud_mariadb_root_password }}"
   command: '/usr/local/bin/helmfile -b /snap/bin/helm -e oas -f /oas/source/repos/helmfiles/helmfile.d/ apply --suppress-secrets'
-
-- 
GitLab