From f3cca619576192f3f77962c3270504bd81460aaf Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 15 Oct 2024 16:21:08 +0200 Subject: [PATCH] logdetective: cleanup playbook (lint) --- .../logdetective01.fedorainfracloud.org.yml | 53 ++++++++----------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/playbooks/hosts/logdetective01.fedorainfracloud.org.yml b/playbooks/hosts/logdetective01.fedorainfracloud.org.yml index 5f4be2e4a5..e83c6a26f0 100644 --- a/playbooks/hosts/logdetective01.fedorainfracloud.org.yml +++ b/playbooks/hosts/logdetective01.fedorainfracloud.org.yml @@ -1,48 +1,39 @@ +--- - name: check/create instance hosts: logdetective user: root - gather_facts: False + gather_facts: false vars_files: - - /srv/web/infra/ansible/vars/global.yml - - /srv/private/ansible/vars.yml + - /srv/web/infra/ansible/vars/global.yml + - /srv/private/ansible/vars.yml handlers: - - import_tasks: "{{ handlers_path }}/restart_services.yml" + - import_tasks: "{{ handlers_path }}/restart_services.yml" tasks: - - import_tasks: "{{ tasks_path }}/aws_cloud.yml" - when: datacenter == 'aws' + - import_tasks: "{{ tasks_path }}/aws_cloud.yml" + when: datacenter == 'aws' - - import_tasks: "{{ tasks_path }}/swap.yml" - when: - - datacenter == 'aws' - - swap_file_size_mb is defined - -- name: cloud basic setup - hosts: logdetective - become: True - become_user: root - gather_facts: True - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - /srv/private/ansible/vars.yml - - pre_tasks: - - import_tasks: "{{ tasks_path }}/yumrepos.yml" + - import_tasks: "{{ tasks_path }}/swap.yml" + when: + - datacenter == 'aws' + - swap_file_size_mb is defined - name: provision instance hosts: logdetective - become: True + become: true become_user: root - gather_facts: True - + gather_facts: true vars_files: - - /srv/web/infra/ansible/vars/global.yml - - /srv/private/ansible/vars.yml - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + - /srv/web/infra/ansible/vars/global.yml + - /srv/private/ansible/vars.yml + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + pre_tasks: + - import_tasks: "{{ tasks_path }}/yumrepos.yml" # Roles are run first, before tasks, regardless of where you place them here. roles: - - base - - logdetective - - nagios_client + - base + - logdetective + - nagios_client