From 40ecfae8024a03fac4aacb7fb2d4083e6785118b Mon Sep 17 00:00:00 2001
From: Chris Hines <chris.hines@monash.edu>
Date: Tue, 16 Aug 2016 13:45:09 +1000
Subject: [PATCH] tweak the gpu role to create xorg.conf files

Former-commit-id: f6fa7ef3475deeef6236d7b152b6d78178cae1e1
---
 roles/gpu/tasks/main.yml | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/roles/gpu/tasks/main.yml b/roles/gpu/tasks/main.yml
index b35c8890..3e5683bb 100644
--- a/roles/gpu/tasks/main.yml
+++ b/roles/gpu/tasks/main.yml
@@ -45,11 +45,6 @@
   become: true
   become_user: root
 
-- name: enable persistenced on boot
-  service: name=nvidia-persistenced state=started enabled=yes
-  become: true
-  become_user: root
-
 
 - name: remove nouveau
   modprobe: name=nouveau state=absent
@@ -88,3 +83,15 @@
   shell: nvidia-smi --gom=0
   become: true
   become_user: root
+
+- name: enable persistenced on boot
+  service: name=nvidia-persistenced state=started enabled=yes
+  become: true
+  become_user: root
+
+- name: Configure xorg.conf with nvidia-xconfig so xorg.conf matches gpu number
+  shell: /usr/bin/nvidia-xconfig -a --use-display-device=none
+  become: true
+  become_user: root
+  args: 
+    creates: /etc/X11/xorg.conf
-- 
GitLab