From 32d47c836dd9465a4c2e7db7cf69120bab9db665 Mon Sep 17 00:00:00 2001
From: gdoucet <gd@geoffroydoucet.com>
Date: Tue, 11 Dec 2018 05:43:21 -0500
Subject: [PATCH] Adding is_atomic in centos bootstrap-os (#3873)

Adding fact is_atomic in bootstrap-centos.yml.

Fix issue: #3538
---
 roles/bootstrap-os/tasks/bootstrap-centos.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/roles/bootstrap-os/tasks/bootstrap-centos.yml b/roles/bootstrap-os/tasks/bootstrap-centos.yml
index 142842b8e..692fae868 100644
--- a/roles/bootstrap-os/tasks/bootstrap-centos.yml
+++ b/roles/bootstrap-os/tasks/bootstrap-centos.yml
@@ -1,4 +1,11 @@
 ---
+- name: check if atomic host
+  stat:
+    path: /run/ostree-booted
+  register: ostree
+
+- set_fact:
+    is_atomic: "{{ ostree.stat.exists }}"
 
 - name: Check presence of fastestmirror.conf
   stat:
@@ -30,8 +37,12 @@
     packages:
       - libselinux-python
       - epel-release
+  when:
+    - not is_atomic
 
 - name: Install pip for bootstrap
   yum:
     name: python-pip
     state: present
+  when:
+    - not is_atomic
-- 
GitLab