From 08c215422024215202e504faebfba709f7f896cb Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Tue, 16 Jan 2018 15:01:27 +0100 Subject: [PATCH] Fix indentation, reorder tasks --- Manual.org | 13 +++++++------ roles/yavdr-xorg/tasks/detect-xorg.yml | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Manual.org b/Manual.org index 7385972..570745c 100644 --- a/Manual.org +++ b/Manual.org @@ -1903,18 +1903,19 @@ xorg_data: {} - name: save results block: - - name: write xorg and xrandr variable to xorg_data dictionary - - set_fact: + - name: ensure facts.d directory exists + file: + state: directory + path: /etc/ansible/facts.d + + - name: set xorg and xrandr in xorg_data dictionary + set_fact: xorg_data: '{{ xorg_data|combine({item[0]: item[1]}) }}' with_items: - ('xorg', xorg) - ('xrandr', xrandr['Screen 0:']) - name: write xorg variable to /etc/yavdr/xorg.yml - block: - - file: - state: directory - path: /etc/ansible/facts.d - copy: content: '{{ xorg_data | to_nice_json }}' dest: /etc/ansible/facts.d/xorg.fact diff --git a/roles/yavdr-xorg/tasks/detect-xorg.yml b/roles/yavdr-xorg/tasks/detect-xorg.yml index 0b34881..e3c967a 100644 --- a/roles/yavdr-xorg/tasks/detect-xorg.yml +++ b/roles/yavdr-xorg/tasks/detect-xorg.yml @@ -101,18 +101,19 @@ - name: save results block: - - name: write xorg and xrandr variable to xorg_data dictionary - - set_fact: + - name: ensure facts.d directory exists + file: + state: directory + path: /etc/ansible/facts.d + + - name: set xorg and xrandr in xorg_data dictionary + set_fact: xorg_data: '{{ xorg_data|combine({item[0]: item[1]}) }}' with_items: - ('xorg', xorg) - ('xrandr', xrandr['Screen 0:']) - name: write xorg variable to /etc/yavdr/xorg.yml - block: - - file: - state: directory - path: /etc/ansible/facts.d - copy: content: '{{ xorg_data | to_nice_json }}' dest: /etc/ansible/facts.d/xorg.fact