Skip to content

Commit

Permalink
Merge pull request #55 from arillso/fix/loops
Browse files Browse the repository at this point in the history
# Improvements to Ansible Roles: Package Conversions and Systemd Unit Options
  • Loading branch information
sbaerlocher authored Jun 18, 2024
2 parents 9ac8097 + 31f9665 commit b40fda4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions roles/maintenance/tasks/maintenance_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
arillso.system.apt_update_info:
register: register_update

- name: Run arillso Apt Package
- name: Convert package list and run arillso Apt Package role
ansible.builtin.include_role:
name: arillso.system.apt_packages
vars:
apt_packages_list: "{{ register_update.packages }}"
apt_packages_list: >-
{{
register_update.packages | map('dict', {'name': item.package, 'version': item.available}) | list
}}
5 changes: 4 additions & 1 deletion roles/systemd_unit/templates/unit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
{{ systemd_unit_option }}
{% endfor %}
{% endif %}
{% if systemd_unit_install_options | length %}
{% if systemd_unit_install_options | length or (systemd_unit_type == 'timer' and 'WantedBy=timers.target' not in systemd_unit_install_options) %}
[Install]
{% if systemd_unit_type == 'timer' and 'WantedBy=timers.target' not in systemd_unit_install_options %}
WantedBy=timers.target
{% endif %}
{% for systemd_unit_install_option in systemd_unit_install_options %}
{{ systemd_unit_install_option }}
{% endfor %}
Expand Down

0 comments on commit b40fda4

Please sign in to comment.