From a5a260d9ed6006f2c4182d5269675347e461fa84 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 18 Aug 2024 23:49:57 +0200 Subject: [PATCH] bitwarden --- playbooks/00_check_for_reboot.yml | 4 ++-- playbooks/00_install_zabbix_agent.yml | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/playbooks/00_check_for_reboot.yml b/playbooks/00_check_for_reboot.yml index 4fd1d42..738615b 100644 --- a/playbooks/00_check_for_reboot.yml +++ b/playbooks/00_check_for_reboot.yml @@ -1,7 +1,7 @@ - hosts: odroid_cluster name: Check for reboot become: true - gather_facts: no + gather_facts: false tasks: - name: Check if file exists using stat module stat: @@ -13,7 +13,7 @@ var: file_status.stat.exists - name: Reboot the server tags: reboot - become: yes + become: true become_user: root shell: "sleep 5 && reboot" async: 1 diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 2421c58..659fcbf 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -25,25 +25,26 @@ # ansible.builtin.copy: # src: packages/zabbix-release_6.4-1+ubuntu22.04_all.deb # dest: /tmp/ - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet1 ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb when: - ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet2 ansible.builtin.apt: #deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb deb: https://repo.zabbix.com/zabbix/7.0/raspbian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian11_all.deb retries: 5 delay: 5 when: - - ansible_facts.architecture == "armv7l" + - ansible_facts.architecture == "armv7l" or ansible_facts.architecture == "aarch64" + ignore_errors: true become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet3 ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb @@ -51,14 +52,13 @@ - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "11" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet4 ansible.builtin.apt: #deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb deb: https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian12_all.deb when: - - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" - - + - ansible_facts.architecture != "armv7l" and ansible_facts.architecture != "aarch64" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" # - name: Install a .deb package localy # ansible.builtin.apt: @@ -67,7 +67,9 @@ ansible.builtin.apt: name: - zabbix-agent2 - - zabbix-agent2-plugin-* + - zabbix-agent2-plugin-mongodb + - zabbix-agent2-plugin-postgresql + - zabbix-agent2-plugin-mssql update_cache: yes when: inventory_hostname not in groups['nas'] become: "{{ false if inventory_hostname in groups['nas'] else true }}" @@ -98,6 +100,7 @@ # path: /"{{ zabbix_agent_cfg }}" # regexp: "^ListenIP=.*" # line: "ListenIP=0.0.0.0" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Reconfigure zabbix-agent2 hostname ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" @@ -134,7 +137,7 @@ groups: video append: yes when: inventory_hostname not in groups['nas'] - + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Restart zabbix-agent2 service ansible.builtin.service: