Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default "item" in with_items with unique name to avoid clashes #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
- MOLECULE_DISTRO: debian10

install:
- pip install molecule yamllint ansible-lint docker
- pip install molecule[docker] yamllint ansible-lint docker

script:
- molecule test
Expand Down
7 changes: 4 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
become: true
template:
src: 'etc/logrotate.d/application.j2'
dest: '/etc/logrotate.d/{{ item.name }}'
dest: '/etc/logrotate.d/{{ logrotate_applications_item.name }}'
owner: root
group: root
mode: 0644
with_items:
- '{{ logrotate_applications }}'
loop: '{{ logrotate_applications }}'
loop_control:
loop_var: logrotate_applications_item
tags:
- configuration

Expand Down
2 changes: 1 addition & 1 deletion templates/etc/logrotate.d/application.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ ansible_managed | comment }}

{% for definition in item.definitions %}
{% for definition in logrotate_applications_item.definitions %}
{{ definition.logs | join(" ") }} {
{% for option in definition.options %}
{{ option }}
Expand Down