This commit is contained in:
ladislav.dusa 2024-11-24 16:01:05 +01:00
commit 1d72006af2
3 changed files with 11 additions and 9 deletions

View File

@ -73,7 +73,7 @@
- zabbix-agent2 - zabbix-agent2
- zabbix-agent2-plugin-mongodb - zabbix-agent2-plugin-mongodb
- zabbix-agent2-plugin-postgresql - zabbix-agent2-plugin-postgresql
- zabbix-agent2-plugin-mysql # - zabbix-agent2-plugin-mysql
update_cache: yes update_cache: yes
ignore_errors: true ignore_errors: true
when: inventory_hostname != 'nas.home.lan' when: inventory_hostname != 'nas.home.lan'

View File

@ -20,7 +20,7 @@
nas-public -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Public nas-public -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Public
nas-install -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/install nas-install -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/install
nas-media -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Media nas-media -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Media
nas-downloads -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/Download nas-downloads -fstype=cifs,credentials=/etc/auto.auth,dir_mode=0755,file_mode=0755,uid=jd,rw ://nas.home.lan/downloads
- name: Reconfigure zabbix agent Server - name: Reconfigure zabbix agent Server
ansible.builtin.lineinfile: ansible.builtin.lineinfile:

View File

@ -3,7 +3,7 @@
ignore_unreachable: false ignore_unreachable: false
ignore_errors: true ignore_errors: true
vars: vars:
dest_folder: "/tmp/ans_repo" dest_folder: "/share/Public/ans_repo1"
tasks: tasks:
# - name: Install python3-pip # - name: Install python3-pip
# ansible.builtin.apt: # ansible.builtin.apt:
@ -17,7 +17,7 @@
ansible.builtin.include_vars: ansible.builtin.include_vars:
file: ../jaydee.yml file: ../jaydee.yml
- name: GIT pull - name: GIT pull
become: true become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
tags: tags:
- git_pull - git_pull
git: git:
@ -80,16 +80,19 @@
dest: /etc/init.d/ dest: /etc/init.d/
mode: '755' mode: '755'
owner: admin owner: admin
remote_src: true
when: inventory_hostname == 'nas.home.lan' when: inventory_hostname == 'nas.home.lan'
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
- debug:
msg: "{{ dest_folder }}"
- name: Upload service script2 - name: Upload service script2
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ dest_folder }}/mqtt_srv.py" src: "{{ dest_folder }}/mqtt_srv.py"
dest: /usr/bin/ dest: /usr/bin/mqtt_srv.py
mode: '755' mode: '755'
owner: admin owner: admin
when: inventory_hostname == 'router.home.lan' remote_src: true
when: inventory_hostname == 'nas.home.lan'
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
- name: Install bottle python package - name: Install bottle python package
@ -103,7 +106,6 @@
when: inventory_hostname != 'nas.home.lan' when: inventory_hostname != 'nas.home.lan'
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
- name: Just force systemd to reread configs (2.4 and above) - name: Just force systemd to reread configs (2.4 and above)
ansible.builtin.systemd: ansible.builtin.systemd:
daemon_reload: true daemon_reload: true
@ -123,6 +125,6 @@
ansible.builtin.shell: "(/etc/init.d/mqtt_srv.sh restart >/dev/null 2>&1 &)" ansible.builtin.shell: "(/etc/init.d/mqtt_srv.sh restart >/dev/null 2>&1 &)"
async: 10 async: 10
poll: 0 poll: 0
when: inventory_hostname != 'nas.home.lan' when: inventory_hostname == 'nas.home.lan'
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"