Add task to copy a channels.conf if it doesn't exist yet

to use this task assing a path pointing to the wanted channels.conf to
the vdr_channels_conf variable, e.g. in host_vars/localhost.yml:

vdr_channels_conf: /path/to/own_config/channels.conf
This commit is contained in:
Alexander Grothe 2019-03-18 16:08:37 +01:00
parent d86e5f2159
commit 811686490f
2 changed files with 22 additions and 1 deletions

View File

@ -1100,6 +1100,16 @@ The additional plugins to install can be set in the variable ~{{vdr_plugins}}~ i
group: '{{ vdr.group }}' group: '{{ vdr.group }}'
mode: 0644 mode: 0644
force: no force: no
- name: "vdr configuration | copy channels.conf if it doesn't exist yes"
copy:
src: '{{ vdr_channels_conf }}'
dest: '{{ vdr.confdir }}/channels.conf'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0644
force: no
when: vdr_channels_conf is defined
#+END_SRC #+END_SRC
**** start vdr after network-online.target **** start vdr after network-online.target
@ -6205,7 +6215,8 @@ WantedBy=multi-user.target
:PROPERTIES: :PROPERTIES:
:ID: 73609a51-8209-47c2-82a0-48838f47b884 :ID: 73609a51-8209-47c2-82a0-48838f47b884
:END: :END:
#+BEGIN_SRC conf #+BEGIN_SRC jinja2
{{ ansible_managed | comment }}
# ----- GLOBAL SECTION ----- # ----- GLOBAL SECTION -----
#Set loglevel for logging to /var/log/mediasrv.log #Set loglevel for logging to /var/log/mediasrv.log
#autoupdate=[on|off] #enable automatic driver update, default off #autoupdate=[on|off] #enable automatic driver update, default off

View File

@ -74,6 +74,16 @@
group: '{{ vdr.group }}' group: '{{ vdr.group }}'
mode: 0644 mode: 0644
force: no force: no
- name: "vdr configuration | copy channels.conf if it doesn't exist yes"
copy:
src: '{{ vdr_channels_conf }}'
dest: '{{ vdr.confdir }}/channels.conf'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0644
force: no
when: vdr_channels_conf is defined
- name: create directory for vdr.service systemd drop-in files - name: create directory for vdr.service systemd drop-in files
file: file:
dest: '{{ item }}' dest: '{{ item }}'