Write data from xorg-detect as local facts for futher usage

This commit is contained in:
Alexander Grothe 2018-01-19 07:51:38 +01:00
parent e51cfe4447
commit 4d393d924f
3 changed files with 14 additions and 21 deletions

View File

@ -1908,18 +1908,15 @@ first_run: False
state: directory state: directory
path: /etc/ansible/facts.d path: /etc/ansible/facts.d
- name: set xorg and xrandr in xorg_data dictionary - name: write xorg variable as local fact
set_fact:
xorg_data: '{{ xorg_data|combine({"xorg": xorg, "xrandr": xrandr}) }}'
- name: print xorg_data
debug:
var: xorg_data
- name: write xorg variable to /etc/yavdr/xorg.yml
copy: copy:
content: '{{ xorg_data | to_nice_json }}' content: '{{ {"xorg": xorg} | to_nice_json }}'
dest: /etc/ansible/facts.d/xorg.fact dest: /etc/ansible/facts.d/xorg.fact
- name: write xrandr variable as local fact
copy:
content: '{{ {"xrandr": xrandr} | to_nice_json }}'
dest: /etc/ansible/facts.d/xrandr.fact
when: when:
- xrandr is defined - xrandr is defined
- xorg is defined - xorg is defined

View File

@ -1,2 +1 @@
first_run: False first_run: False
xorg_data: {}

View File

@ -106,18 +106,15 @@
state: directory state: directory
path: /etc/ansible/facts.d path: /etc/ansible/facts.d
- name: set xorg and xrandr in xorg_data dictionary - name: write xorg variable as local fact
set_fact:
xorg_data: '{{ xorg_data|combine({"xorg": xorg, "xrandr": xrandr}) }}'
- name: print xorg_data
debug:
var: xorg_data
- name: write xorg variable to /etc/yavdr/xorg.yml
copy: copy:
content: '{{ xorg_data | to_nice_json }}' content: '{{ {"xorg": xorg} | to_nice_json }}'
dest: /etc/ansible/facts.d/xorg.fact dest: /etc/ansible/facts.d/xorg.fact
- name: write xrandr variable as local fact
copy:
content: '{{ {"xrandr": xrandr} | to_nice_json }}'
dest: /etc/ansible/facts.d/xrandr.fact
when: when:
- xrandr is defined - xrandr is defined
- xorg is defined - xorg is defined