From e2ad4647c8117e533cf9d2aca6aa41920aff5d0d Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 19 Nov 2024 23:36:39 +0100 Subject: [PATCH] bitwarden --- hosts_init.yml | 36 ++++++++++++++++++++++++++++------ playbooks/install_mqtt_srv.yml | 26 ++++++++++++++++++------ 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/hosts_init.yml b/hosts_init.yml index e141576..5a6704d 100644 --- a/hosts_init.yml +++ b/hosts_init.yml @@ -1,7 +1,31 @@ --- -odroid_cluster: - hosts: - 192.168.77.16[1:5]: - vars: - ansible_ssh_user: root - ansible_ssh_pass: 1234 \ No newline at end of file +datacenter: + children: + servers: + hosts: + rpi5-1.home.lan: + rpi5.home.lan: + m-server.home.lan: + fog.home.lan: + zabbix.home.lan: + omv.home.lan: + 192.168.77.101: + vars: + ansible_python_interpreter: /usr/bin/python3 + ansible_ssh_user: jd + # ansible_ssh_password: l4c1j4yd33Du5lo + ansible_become_password: l4c1j4yd33Du5lo + identity_file: ssh_key.pem + ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_become_user: root + nas: + hosts: + nas.home.lan: + 192.168.77.106: + vars: + ansible_ssh_user: admin + become_method: su + become_user: admin + # ansible_user: admin + # ansible_pass: l4c1!j4yd33?Du5lo1 + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 59116df..01bf8ba 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -2,6 +2,8 @@ name: Install mqtt_srv ignore_unreachable: false ignore_errors: true + vars: + dest_folder: "/tmp/ans_repo" tasks: # - name: Install python3-pip # ansible.builtin.apt: @@ -11,13 +13,25 @@ # when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] # become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - + - name: include vault + ansible.builtin.include_vars: + file: ../jaydee.yml + - name: GIT pull + become: true + tags: + - git_pull + git: + repo: "https://{{ git_user | urlencode }}:{{ git_password | urlencode }}@gitlab.sectorq.eu/jaydee/mqtt_srv.git" + dest: "{{ dest_folder }}" + update: yes + clone: yes + version: main - debug: msg: "{{ inventory_hostname }}" - name: Upload service config ansible.builtin.copy: - src: services/mqtt_srv.service + src: "{{ dest_folder }}/mqtt_srv.service" dest: /etc/systemd/system/ when: inventory_hostname != 'nas.home.lan' become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}" @@ -26,7 +40,7 @@ - name: Upload service script ansible.builtin.copy: - src: scripts/mqtt_srv.py + src: "{{ dest_folder }}/mqtt_srv.py" dest: /usr/bin/ mode: '755' owner: root @@ -35,7 +49,7 @@ - name: Upload service script config ansible.builtin.copy: - src: scripts/mqtt_srv.cfg + src: "{{ dest_folder }}/mqtt_srv.cfg" dest: /etc/mqtt_srv/ mode: '755' owner: root @@ -62,7 +76,7 @@ - name: Upload service script1 ansible.builtin.copy: - src: scripts/mqtt_srv.sh + src: "{{ dest_folder }}/mqtt_srv.sh" dest: /etc/init.d/ mode: '755' owner: admin @@ -71,7 +85,7 @@ - name: Upload service script2 ansible.builtin.copy: - src: scripts/mqtt_srv.py + src: "{{ dest_folder }}/mqtt_srv.py" dest: /usr/bin/ mode: '755' owner: admin