bitwarden

This commit is contained in:
jaydee 2024-08-18 23:49:57 +02:00
parent 92f3fea8d0
commit a5a260d9ed
2 changed files with 15 additions and 12 deletions

View File

@ -1,7 +1,7 @@
- hosts: odroid_cluster - hosts: odroid_cluster
name: Check for reboot name: Check for reboot
become: true become: true
gather_facts: no gather_facts: false
tasks: tasks:
- name: Check if file exists using stat module - name: Check if file exists using stat module
stat: stat:
@ -13,7 +13,7 @@
var: file_status.stat.exists var: file_status.stat.exists
- name: Reboot the server - name: Reboot the server
tags: reboot tags: reboot
become: yes become: true
become_user: root become_user: root
shell: "sleep 5 && reboot" shell: "sleep 5 && reboot"
async: 1 async: 1

View File

@ -25,25 +25,26 @@
# ansible.builtin.copy: # ansible.builtin.copy:
# src: packages/zabbix-release_6.4-1+ubuntu22.04_all.deb # src: packages/zabbix-release_6.4-1+ubuntu22.04_all.deb
# dest: /tmp/ # dest: /tmp/
- name: Install a .deb package from the internet - name: Install a .deb package from the internet1
ansible.builtin.apt: 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 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: when:
- ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu" - ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu"
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" 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: 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/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 deb: https://repo.zabbix.com/zabbix/7.0/raspbian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian11_all.deb
retries: 5 retries: 5
delay: 5 delay: 5
when: when:
- ansible_facts.architecture == "armv7l" - ansible_facts.architecture == "armv7l" or ansible_facts.architecture == "aarch64"
ignore_errors: true ignore_errors: true
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" 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: 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 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" - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "11"
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" 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: 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/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 deb: https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian12_all.deb
when: 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 # - name: Install a .deb package localy
# ansible.builtin.apt: # ansible.builtin.apt:
@ -67,7 +67,9 @@
ansible.builtin.apt: ansible.builtin.apt:
name: name:
- zabbix-agent2 - zabbix-agent2
- zabbix-agent2-plugin-* - zabbix-agent2-plugin-mongodb
- zabbix-agent2-plugin-postgresql
- zabbix-agent2-plugin-mssql
update_cache: yes update_cache: yes
when: inventory_hostname not in groups['nas'] when: inventory_hostname not in groups['nas']
become: "{{ false if inventory_hostname in groups['nas'] else true }}" become: "{{ false if inventory_hostname in groups['nas'] else true }}"
@ -98,6 +100,7 @@
# path: /"{{ zabbix_agent_cfg }}" # path: /"{{ zabbix_agent_cfg }}"
# regexp: "^ListenIP=.*" # regexp: "^ListenIP=.*"
# line: "ListenIP=0.0.0.0" # line: "ListenIP=0.0.0.0"
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
- name: Reconfigure zabbix-agent2 hostname - name: Reconfigure zabbix-agent2 hostname
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: "{{ zabbix_agent_cfg }}" path: "{{ zabbix_agent_cfg }}"
@ -134,7 +137,7 @@
groups: video groups: video
append: yes append: yes
when: inventory_hostname not in groups['nas'] when: inventory_hostname not in groups['nas']
become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}"
- name: Restart zabbix-agent2 service - name: Restart zabbix-agent2 service
ansible.builtin.service: ansible.builtin.service: