Skip to content

Commit a8a6198

Browse files
author
Bill Meek
committed
Single Role: put missing package case in a block
Adds Rocky special tasks. Improves the missing.yml content (and actually uses it). Fix missing .yml text in with_first_found.
1 parent 4ace530 commit a8a6198

File tree

8 files changed

+32
-38
lines changed

8 files changed

+32
-38
lines changed

Docker/centos:8.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ RUN sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
1515
WORKDIR /root/source/ansible
1616
COPY . ./
1717
# RUN ./mythtv.yml --limit=localhost --extra-vars='{"venv_active": true}' --extra-vars='{"use_old_roles": false}'
18-
#
18+
#
1919
# WORKDIR /root/source
2020
# RUN git clone https://github.com/MythTV/mythtv.git
21-
#
21+
#
2222
# # buld fails because FFmpeg can't find libiec61883 (even though it and
2323
# # libiec61883-devel are installed
2424
# WORKDIR /root/source/mythtv
25-
#
25+
#
2626
# RUN if [ "${NOBUILD}" -eq 1 ]; then \
2727
# echo "Not doing a build." ;\
2828
# else \

Docker/centos:9.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WORKDIR /root/source/ansible
77
COPY . ./
88
RUN ansible-galaxy collection install --requirements-file=requirements.yml \
99
&& ./mythtv.yml --limit=localhost --extra-vars='{"venv_active": true}' --extra-vars='{"use_old_roles": false}'
10-
10+
1111
WORKDIR /root/source
1212
RUN git clone https://github.com/MythTV/mythtv.git
1313

Docker/devuan:devuan.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ WORKDIR /root/source/ansible
99
COPY . ./
1010
########### RUN ansible-galaxy collection install --requirements-file=requirements.yml \
1111
########### && ./mythtv.yml --limit=localhost --extra-vars='{"venv_active": true}' --extra-vars='{"use_old_roles": false}'
12-
###########
12+
###########
1313
########### WORKDIR /root/source
1414
########### RUN git clone https://github.com/MythTV/mythtv.git
15-
###########
15+
###########
1616
########### WORKDIR /root/source/mythtv
1717
########### RUN if [ "${NOBUILD}" -eq 1 ]; then \
1818
########### echo "Not doing a build." ;\

Docker/fedora:41.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ COPY . ./
88

99
################### WORKDIR /root/source
1010
################### RUN git clone https://github.com/MythTV/mythtv.git
11-
###################
11+
###################
1212
################### WORKDIR /root/source/mythtv
1313
################### RUN if [ "${NOBUILD}" -eq 1 ]; then \
1414
################### echo "Not doing a build." ;\

Docker/fedora:42.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ WORKDIR /root/source/ansible
66
COPY . ./
77
############# RUN ./mythtv.yml --limit=localhost
88
############# RUN ./mythtv.yml --limit=localhost --extra-vars='{"venv_active": true}' --extra-vars='{"use_old_roles": false}'
9-
#############
9+
#############
1010
############# WORKDIR /root/source
1111
############# RUN git clone https://github.com/MythTV/mythtv.git
12-
#############
12+
#############
1313
############# WORKDIR /root/source/mythtv
1414
############# RUN if [ "${NOBUILD}" -eq 1 ]; then \
1515
############# echo "Not doing a build." ;\

Docker/opensuse:leap.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN if [ "${NOBUILD}" -eq 1 ]; then \
2929
# # BE CAREFUL WITH THE NEXT LINE
3030
# RUN make --jobs=4
3131
# RUN make install
32-
#
32+
#
3333
# WORKDIR /root/source/mythtv/mythplugins
3434
# RUN ./configure
3535
# # # BE CAREFUL WITH THE NEXT LINE

roles/mythtv/tasks/main.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,35 @@
1414
versno: '{{ ansible_distribution_major_version | int }}'
1515
my_dir: '{{ playbook_dir }}/roles/mythtv'
1616

17-
- name: Care for empty drelse names
18-
set_fact:
19-
drelse: 'na'
20-
when: not drelse
21-
2217
- name: See if special setup tasks exist
2318
stat:
2419
path: '{{ my_dir }}/tasks/{{ pkgmgr }}_{{ distro }}.yml'
2520
register: special_stat_results
2621

27-
- name: Run special setup tasks
22+
- name: Run any special setup tasks
2823
include_tasks:
2924
file: '{{ pkgmgr }}_{{ distro }}.yml'
3025
when: special_stat_results.stat.exists
3126

32-
- name: 'Load packages for "{{ pkgmgr }}/{{ distro }}/{{ versno }}"' # noqa name[template]
27+
- name: 'Load packages for: "{{ pkgmgr }}/{{ distro }}/{{ versno }}"' # noqa name[template]
3328
include_vars:
3429
file: '{{ item }}'
3530
with_first_found:
3631
- '{{ pkgmgr }}/{{ distro }}/{{ versno }}.yml'
37-
- '{{ pkgmgr }}/{{ distro }}/{{ drelse }}'
32+
- '{{ pkgmgr }}/{{ distro }}/{{ drelse }}.yml'
3833
- '{{ pkgmgr }}/{{ distro }}/rolling.yml'
3934
- missing.yml
40-
register: include_vars_results
4135

42-
- name: 'The list of packages is missing. {{ manual_action_text }}'
43-
when:
44-
- include_vars_results.results[0] is defined
45-
- include_vars_results.results[0].failed or
46-
include_vars_results.results[0].item is search("missing.yml")
36+
- name: Warn the user and end this play
37+
when: packages is undefined
4738
block:
48-
- debug:
49-
msg: >-
50-
No {{ pkgmgr }}/{{ distro }}/{{ versno }}.yml file. One can
51-
be copied and adjusted for a new release. Files are stored under:
52-
{{ playbook_dir }}/roles/mythtv/vars.
53-
Openining an issue at: https://github.com/MythTV/ansible/issues is the
54-
correct way to have new package lists added to the project. Be sure to
55-
add the output of the: {{ instruction_text }} section from this play.
39+
- name: 'Missing package alert: {{ manual_action_text }}'
40+
debug:
41+
msg: '{{ playbook_dir }}/roles/mythtv/vars/{{ pkgmgr }}/{{ distro }}/{{ versno }}.yml is missing.
42+
{{ missing_package_message }}: {{ instruction_text }}'
5643

57-
- meta: end_play
44+
- name: Ending this play
45+
meta: end_play
5846

5947
- name: Add qt5 packages
6048
set_fact:

roles/mythtv/vars/missing.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# roles/mythtv/vars
1+
# roles/mythtv/vars/missing.yml
2+
3+
# This is used by ../tasks/main.yml to care for the case of missing package
4+
# lists.
25

36
---
47

5-
why_is_this_here: >-
6-
A nearly empty YAML file here to prevent the "with_first_found:"
7-
conditional in ../tasks/main.yml from failing if the other choices
8-
aren't found.
8+
missing_package_message: >-
9+
One can be copied from an existing distribution and modified as required. To
10+
get this added to the MythTV Ansible repository, open an issue at
11+
https://github.com/MythTV/ansible/issues. Be sure to include the
12+
output at the beginning of this run marked
913
1014
...
15+
16+
# vim: set expandtab tabstop=2 shiftwidth=2 smartindent noautoindent colorcolumn=80:

0 commit comments

Comments
 (0)