From f3d2ae665a3be620e91f2f2db47eaeac0c819753 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 8 Feb 2019 19:24:45 +0100 Subject: added role to configure info-beamer --- roles/info-beamer/config/defaults/main.yml | 42 +++++++++++++++ roles/info-beamer/config/tasks/main.yml | 84 ++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 roles/info-beamer/config/defaults/main.yml create mode 100644 roles/info-beamer/config/tasks/main.yml (limited to 'roles/info-beamer') diff --git a/roles/info-beamer/config/defaults/main.yml b/roles/info-beamer/config/defaults/main.yml new file mode 100644 index 00000000..7d0609e9 --- /dev/null +++ b/roles/info-beamer/config/defaults/main.yml @@ -0,0 +1,42 @@ +--- +## path to the info-beamer boot partition +# info_beamer_base_path: + +info_beamer_tvservices: + 1080i50: "CEA 20" + 1080p25: "CEA 33" + 1080p50: "CEA 31" + 1080p60: "DMT 82" + 576p: "CEA 17" + 576p_wide: "CEA 18" + 576p_wide_quad: "CEA 38" + 720p50: "CEA 19" + 720p60: "CEA 4" + +# info_beamer_tvservice: "{{ info_beamer_tvservices['1080i50'] }}" + +## 'local' or 'hdmi' +# info_beamer_audio_target: "hdmi" + +# info_beamer_ssh_keys: "{{ ssh_root_keys }}" + +info_beamer_feature_flags: + p2p: "{{ info_beamer_feature_p2p | default(true) }}" + prefer_wired: "{{ info_beamer_prefer_wired | default(true) }}" + +# info_beamer_network: +# address: "192.0.0.1" +# netmask: "255.255.255.0" +# gateway: "192.0.2.254" +# dns: "9.9.9.9" + +# info_beamer_wireless: +# ssid: "Infoscreens" +# key: "very-secret" + +## path to file will be installed using 'copy' module +# info_beamer_branding_logo: "" +# info_beamer_branding_background: "" +# info_beamer_branding_video: "" + +# info_beamer_device_connect_key: "" diff --git a/roles/info-beamer/config/tasks/main.yml b/roles/info-beamer/config/tasks/main.yml new file mode 100644 index 00000000..b4627fb7 --- /dev/null +++ b/roles/info-beamer/config/tasks/main.yml @@ -0,0 +1,84 @@ +--- +- name: check if info-beamer base directory is configured + debug: + msg: "check if base directory is set" + failed_when: not info_beamer_base_path + +- name: remove existing config directory + file: + path: "{{ info_beamer_base_path }}/config" + state: absent + +- name: create new/empty config directory + file: + path: "{{ info_beamer_base_path }}/config" + state: directory + +- name: configure video output resolution + copy: + content: "{{ info_beamer_tvservice }}" + dest: "{{ info_beamer_base_path }}/config/tvservice" + when: info_beamer_tvservice is defined + +- name: configure audio output + copy: + content: "{{ info_beamer_audio_target }}" + dest: "{{ info_beamer_base_path }}/config/audio" + when: info_beamer_audio_target is defined + +- name: configure ssh keys + copy: + content: "{{ info_beamer_ssh_keys | join('\n') }}" + dest: "{{ info_beamer_base_path }}/config/authorized_keys" + when: info_beamer_ssh_keys is defined + +- name: configure wired network interface + copy: + content: | + {{ info_beamer_network.address }} + {{ info_beamer_network.netmask }} + {{ info_beamer_network.gateway }} + {{ info_beamer_network.dns }} + dest: "{{ info_beamer_base_path }}/config/network" + when: info_beamer_network is defined + +- name: configure wireless network interface + copy: + content: | + {{ info_beamer_wireless.ssid }} + {{ info_beamer_wireless.key }} + dest: "{{ info_beamer_base_path }}/config/wireless" + when: info_beamer_wireless is defined + +- name: enable info-beamer feature flags + copy: + content: "" + dest: "{{ info_beamer_base_path }}/config/{{ item.key }}" + with_dict: "{{ info_beamer_feature_flags }}" + when: item.value + loop_control: + label: "{{ item.key }}({{ item.value }}" + +- name: install branding logo + copy: + src: "{{ info_beamer_branding_logo }}" + dest: "{{ info_beamer_base_path }}/config/branding.ppm" + when: info_beamer_branding_logo is defined + +- name: install branding background + copy: + src: "{{ info_beamer_branding_background }}" + dest: "{{ info_beamer_base_path }}/config/branding.jpg" + when: info_beamer_branding_background is defined + +- name: install branding logo + copy: + src: "{{ info_beamer_branding_video }}" + dest: "{{ info_beamer_base_path }}/config/branding.mp4" + when: info_beamer_branding_video is defined + +- name: configure device connect key + copy: + content: "{{ info_beamer_device_connect_key }}" + dest: "{{ info_beamer_base_path }}/config/device-connect-key.txt" + when: info_beamer_device_connect_key is defined -- cgit v1.2.3