Skip to content

Commit

Permalink
ansible: use include_tasks instead of include (#3580)
Browse files Browse the repository at this point in the history
Closes: #3127
  • Loading branch information
targos committed Dec 7, 2023
1 parent 94ae5d3 commit c939177
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 24 deletions.
6 changes: 3 additions & 3 deletions ansible/roles/baselayout/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
lineinfile: state=absent dest="{{ ssh_config }}" regexp=^Subsystem(\s+)sftp

- name: add os-specific repos
include: "{{ repos_include }}"
include_tasks: "{{ repos_include }}"
loop_control:
loop_var: repos_include
with_first_found:
Expand Down Expand Up @@ -167,7 +167,7 @@
- [ 'curl', 'curl_32', 'curl_64', 'gtar', 'python3' ]

- name: run ccache installer
include: "{{ ccache_include }}"
include_tasks: "{{ ccache_include }}"
loop_control:
loop_var: ccache_include
with_first_found:
Expand All @@ -178,7 +178,7 @@
skip: true

- name: set up ntp
include: "{{ ntp_include }}"
include_tasks: "{{ ntp_include }}"
loop_control:
loop_var: ntp_include
with_first_found:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/bootstrap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

- name: run os-specific bootstrap
include: "{{ bootstrap_include }}"
include_tasks: "{{ bootstrap_include }}"
loop_control:
loop_var: bootstrap_include
with_first_found:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/build-test-v8/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

- name: install packages required for V8 builds
include: "{{ v8deps_include }}"
include_tasks: "{{ v8deps_include }}"
loop_control:
loop_var: v8deps_include
with_first_found:
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
regexp: ^Subsystem(\s+)sftp

- name: add os-specific repos
include: "{{ repos_include }}"
include_tasks: "{{ repos_include }}"
loop_control:
loop_var: repos_include
with_first_found:
Expand Down Expand Up @@ -51,7 +51,7 @@
with_items: [ '.login', '.profile' ]

- name: set up ntp
include: "{{ ntp_include }}"
include_tasks: "{{ ntp_include }}"
loop_control:
loop_var: ntp_include
with_first_found:
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/jenkins-worker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@

- name: run scaleway armv7 jenkins-worker setup
when: "'scaleway-ubuntu1804-armv7l' in inventory_hostname"
include: "{{ role_path }}/tasks/partials/scaleway-armv7.yml"
include_tasks: "{{ role_path }}/tasks/partials/scaleway-armv7.yml"

- name: prepare installing tap2junit
when: type != "release"
include: "{{ pip_include }}"
include_tasks: "{{ pip_include }}"
loop_control:
loop_var: pip_include
with_first_found:
Expand Down
3 changes: 1 addition & 2 deletions ansible/roles/package-upgrade/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
# Package upgrade handler

- name: package updated
include: "{{ handler_include }}"
include_tasks: "{{ handler_include }}"
loop_control:
loop_var: handler_include
notify: package updated
with_first_found:
- files:
- "{{ role_path }}/handlers/partials/{{ os }}-{{ arch }}.yml"
Expand Down
3 changes: 1 addition & 2 deletions ansible/roles/package-upgrade/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

- name: include package manager tasks
when: not os|startswith("zos")
include: "partials/{{ template }}.yml"
failed_when: template is False
include_tasks: "partials/{{ template }}.yml"
2 changes: 1 addition & 1 deletion ansible/roles/read-secrets/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
skip: true

- name: decrypt additional secrets
include: "{{ additional_include }}"
include_tasks: "{{ additional_include }}"
loop_control:
loop_var: additional_include
with_first_found:
Expand Down
20 changes: 10 additions & 10 deletions ansible/www-standalone/ansible-playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
- include_vars: ansible-vars.yaml
tags: vars

- include: tasks/base.yaml
- include_tasks: tasks/base.yaml
tags: base

- include: tasks/user.yaml
- include_tasks: tasks/user.yaml
tags: user

- include: tasks/docker.yaml
- include_tasks: tasks/docker.yaml
tags: docker

- include: tasks/site-setup.yaml
- include_tasks: tasks/site-setup.yaml
tags: setup

- include: tasks/webhook.yaml
- include_tasks: tasks/webhook.yaml
tags: webhook

- include: tasks/nginx.yaml
- include_tasks: tasks/nginx.yaml
tags: nginx

- include: tasks/promote.yaml
- include_tasks: tasks/promote.yaml
tags: promote

- include: tasks/tools.yaml
- include_tasks: tasks/tools.yaml
tags: tools

- include: tasks/metrics.yaml
- include_tasks: tasks/metrics.yaml
tags: metrics

- include: tasks/cloudflare.yaml
- include_tasks: tasks/cloudflare.yaml
tags: cloudflare

0 comments on commit c939177

Please sign in to comment.