Skip to content

Commit

Permalink
PMM-12530 use loop instead of with_items
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Dec 12, 2023
1 parent 4fa4250 commit c9d2b83
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/ansible/pmm/post-build-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
owner: pmm
group: pmm
mode: 0775
with_items:
loop:
- absent
- directory

Expand Down
10 changes: 7 additions & 3 deletions build/ansible/roles/pmm-images/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@

when: ansible_virtualization_type == "docker"

- name: Create directories | Create dirs
file: path={{ item }} state=directory owner=pmm group=pmm
with_items:
- name: Create directories
file:
path: "{{ item }}"
state: directory
owner: pmm
group: pmm
loop:
- /srv/prometheus/rules
- /etc/grafana

Expand Down
7 changes: 5 additions & 2 deletions update/ansible/playbook/tasks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@
debug: var=reread_result.stdout_lines

- name: Restart pmm-managed
command: supervisorctl {{ item }} pmm-managed
command: "supervisorctl {{ item }} pmm-managed"
become: true
with_items: ["stop", "remove", "add"]
loop:
- stop
- remove
- add

# Give pmm-managed time to update supervisord configuration,
# and give update UI time to catch up after pmm-managed restart
Expand Down

0 comments on commit c9d2b83

Please sign in to comment.